Why do XML schema attributes disappear?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • asciz@starmail.com

    #1

    Why do XML schema attributes disappear?

    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:schemaLocat ion="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-appelement are missing. The only two attributes shown are
    "version" and "xsi:schemaLoca tion".

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

    Many thanks
    asciz

  • Dimitre Novatchev

    #2
    Re: Why do XML schema attributes disappear?


    <asciz@starmail .comwrote in message
    news:1171881977 .560402.229530@ p10g2000cwp.goo glegroups.com.. .
    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:schemaLocat ion="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-appelement are missing. The only two attributes shown are
    "version" and "xsi:schemaLoca tion".
    >
    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


    Comment

    • Martin Honnen

      #3
      Re: Why do XML schema attributes disappear?

      asciz@starmail. com 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:schemaLocat ion="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-appelement are missing. The only two attributes shown are
      "version" and "xsi:schemaLoca tion".
      >
      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/

      Comment

      • asciz@starmail.com

        #4
        Re: Why do XML schema attributes disappear?

        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 <mahotr...@yaho o.dewrote:
        a...@starmail.c om 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:schemaLocat ion="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-appelement are missing. The only two attributes shown are
        "version" and "xsi:schemaLoca tion".
        >
        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/

        Comment

        • Martin Honnen

          #5
          Re: Why do XML schema attributes disappear?

          asciz@starmail. com 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/

          Comment

          • Dimitre Novatchev

            #6
            Re: Why do XML schema attributes disappear?

            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.a...20021221025528

            Cheers,
            Dimitre Novatchev


            "Martin Honnen" <mahotrash@yaho o.dewrote in message
            news:45d9c85e$0 $23135$9b4e6d93 @newsspool1.arc or-online.net...
            asciz@starmail. com 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/

            Comment

            Working...