Why do XML schema attributes disappear?

Discussion in 'XML' started by asciz@starmail.com, Feb 19, 2007.

  1. Guest

    Hi

    I'm having a problem with an XML file, most likely because of my lack
    of understanding of XML schemas

    I have the following XML file:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Hello</display-name>
    </web-app>

    When I view it in a browser for example, some of the attributes of the
    <web-app> element are missing. The only two attributes shown are
    "version" and "xsi:schemaLocation".

    Does anyone know why the other attributes are removed when viewed?

    Many thanks
    asciz
     
    , Feb 19, 2007
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > Hi
    >
    > I'm having a problem with an XML file, most likely because of my lack
    > of understanding of XML schemas
    >
    > I have the following XML file:
    >
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    > Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    > <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
    > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    > <display-name>Hello</display-name>
    > </web-app>
    >
    > When I view it in a browser for example, some of the attributes of the
    > <web-app> element are missing. The only two attributes shown are
    > "version" and "xsi:schemaLocation".
    >
    > Does anyone know why the other attributes are removed when viewed?


    That simply means that the "pretty-printing" your browser is using is quite
    wrong!

    Try viewing this xml file with (for examle) IE6 or IE7 and you'll see that
    all attributes are displayed.

    Of course, I'd not recommend trusting your browser (BTW, which one is it?)
    for viewing xml!


    Cheers,
    Dimitre Novatchev
     
    Dimitre Novatchev, Feb 19, 2007
    #2
    1. Advertising

  3. wrote:

    > I have the following XML file:
    >
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    > Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    > <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
    > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    > <display-name>Hello</display-name>
    > </web-app>
    >
    > When I view it in a browser for example, some of the attributes of the
    > <web-app> element are missing. The only two attributes shown are
    > "version" and "xsi:schemaLocation".
    >
    > Does anyone know why the other attributes are removed when viewed?


    Which browser is that, Mozilla or Firefox? In that case you are better
    off to directly view the source of the loaded XML.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 19, 2007
    #3
  4. Guest

    Hi, thanks for reply

    I'm using Firefox version 1.5.0.7

    I also have some other software that seem to do it, hence my problem.
    It is JBoss version 3.2.3 that complains that the attributes are
    missing, even though they are actually there in the XML file

    Thanks
    -asciz


    On 19 Feb, 14:49, Martin Honnen <> wrote:
    > wrote:
    > > I have the following XML file:

    >
    > > <?xml version="1.0" encoding="ISO-8859-1"?>
    > > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    > > Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    > > <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
    > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    > >http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    > > <display-name>Hello</display-name>
    > > </web-app>

    >
    > > When I view it in a browser for example, some of the attributes of the
    > > <web-app> element are missing. The only two attributes shown are
    > > "version" and "xsi:schemaLocation".

    >
    > > Does anyone know why the other attributes are removed when viewed?

    >
    > Which browser is that, Mozilla or Firefox? In that case you are better
    > off to directly view the source of the loaded XML.
    >
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
     
    , Feb 19, 2007
    #4
  5. wrote:

    > I'm using Firefox version 1.5.0.7


    Firefox uses a default XSLT stylesheet to transform the XML document to
    some collapsible HTML pretty printing but unfortunately the XSLT
    processor Mozilla has does not support the namespace axis so that is why
    xmlns or xmlns:prefix attributes are not shown.

    > I also have some other software that seem to do it, hence my problem.
    > It is JBoss version 3.2.3 that complains that the attributes are
    > missing, even though they are actually there in the XML file


    I don't know JBoss so I can't help. But not displaying attributes and
    complaining that they are not there are different issues

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 19, 2007
    #5
  6. > Firefox uses a default XSLT stylesheet to transform the XML document to
    > some collapsible HTML pretty printing but unfortunately the XSLT processor
    > Mozilla has does not support the namespace axis so that is why xmlns or
    > xmlns:prefix attributes are not shown.


    The "lack of namespace axis support" is not the reason -- the default
    stylesheet is simply not doing what it's expected to do.

    For comparison, see how the XPath Visualizer for Firefox (Mozilla) handles
    and displays namespace nodes without problems:

    http://www.topxml.com/code/default.asp?p=3&id=v20021221025528

    Cheers,
    Dimitre Novatchev


    "Martin Honnen" <> wrote in message
    news:45d9c85e$0$23135$-online.net...
    > wrote:
    >
    >> I'm using Firefox version 1.5.0.7

    >
    > Firefox uses a default XSLT stylesheet to transform the XML document to
    > some collapsible HTML pretty printing but unfortunately the XSLT processor
    > Mozilla has does not support the namespace axis so that is why xmlns or
    > xmlns:prefix attributes are not shown.
    >
    >> I also have some other software that seem to do it, hence my problem.
    >> It is JBoss version 3.2.3 that complains that the attributes are
    >> missing, even though they are actually there in the XML file

    >
    > I don't know JBoss so I can't help. But not displaying attributes and
    > complaining that they are not there are different issues
    >
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
     
    Dimitre Novatchev, Feb 19, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,637
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    980
    Martin Honnen
    Feb 5, 2004
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,312
    Stanimir Stamenkov
    Apr 25, 2005
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,129
    Smokey Grindel
    Dec 2, 2006
  5. Replies:
    3
    Views:
    3,071
Loading...

Share This Page