SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Problem using XMLDSO with XML containing space preserve tags

    Hi folks,

    I am trying to use XMLDSO to load an XML file into a HTML document and then pick out and display the data.

    For a simple XML file I have this all working fine.

    However, the real world XML file that I will be using (and I have no control over) has an attribute on every single tag for preserving space.

    e.g.

    <start>
    <title xml:space="preserve">Mr</title>
    <firstname xml:space="preserve">Joe</firstname>
    <lastname xml:space="preserve">Bloggs</lastname>
    </start>

    As soon as I add these xml:space="preserve" attributes into my test data, then nothing works i.e. no data is extracted from the XML and no errors.

    When I take them out, the data appears again.

    Does anyone have any ideas what may be happening and how I might workaround this as I cannot change the source XML and would like a solution where I can get XMLDSO to somehow ignore these attributes.

    Regards

    Rod

  2. #2
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Folks,

    Just an update ...

    It doesn't seem to be just related to the space=preserve attribute i.e. if I add any attribute whatsoever to an element it does not display via the XML DSO "data islands" approach. e.g. <title>Mr</title> works whereas <title id="abc">Mr</title> fails.

    Interestingly, if I take the attribute off a tag then the data for that tag appears with the data missing for the remaining tags that have the attribute which suggests that some (possibly all) of the XML data is being loaded OK.

    Regards

    Rod


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •