Re: [xml] Tagged elements inside text



On Tue, Sep 10, 2002 at 07:24:21PM +0200, Fco . Mario Barcala Rodríguez wrote:
  I load an xml document from disk with:
    xmlKeepBlanksDefault(0);
    xmlParseFile(filename);
and i find out problems when loading this xml file:
  <roottag>
    <tag1>text1</tag1>
    <tag2>text2</tag2>
    <tag3>text3<subtag1>text4</subtag1>text5</tag3>
  </roottag>
    The problem is in tag3. it has a "standard node" inside two "text
 nodes". I'm not sure, but i think it's posible and valid in xml
 specification to do this. When i check the node which corresponds to tag3,
 there are three children (all text nodes) and the content of these are:
    1st->text3text5
    2nd->text5
    3rd->text5
    I think the "tag3 node" had to have three children, but of type: "text
node", "standard node", "text node" (the content is intuitive). Isn't it?
    Is there any problem at library implementation in this case, or is
there another problem?

  Sorry, I can't reproduce this:

paphio:~/XML -> cat tst.xml
<roottag>
  <tag1>text1</tag1>
  <tag2>text2</tag2>
  <tag3>text3<subtag1>text4</subtag1>text5</tag3>
</roottag>
paphio:~/XML -> xmllint --debug --noblanks tst.xml
DOCUMENT
version=1.0
URL=tst.xml
standalone=true
  ELEMENT roottag
    ELEMENT tag1
      TEXT
        content=text1
    ELEMENT tag2
      TEXT
        content=text2
    ELEMENT tag3
      TEXT
        content=text3
      ELEMENT subtag1
        TEXT
          content=text4
      TEXT
        content=text5
paphio:~/XML -> 

  --noblanks does the xmlKeepBlanksDefault(0) call
  -- debug dumps the document tree

 "tag3 node" has 3 children, text, element, and text.

  You must have misunderstood something else or have a bug in your code,
use a debugger and see where the error occurs.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]