1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
<?xml version="1.0" ?>
<!DOCTYPE foo [
<!ENTITY % bar "for R and S">
<!ENTITY % foo "for Omegahat">
<!ENTITY testEnt "test entity bar">
<!ENTITY logo SYSTEM "images/logo.gif" NDATA gif>
<!ENTITY % extEnt SYSTEM "http://www.omegahat.net"> <!-- include the contents of the README file in the same directory as this one. -->
<!ELEMENT x (#PCDATA) >
<!ELEMENT y (x)* >
]>
<!-- A comment -->
<foo x="1">
<element attrib1="my value" />
&testEnt;
<?R sum(rnorm(100)) ?>
<a>
<!-- A comment -->
<b>
%extEnt;
</b>
</a>
<![CDATA[
This is escaped data
containing < and &.
]]>
Note that this caused a segmentation fault if replaceEntities was
not TRUE.
That is,
<code>
xmlTreeParse("test.xml", replaceEntities = TRUE)
</code>
works, but
<code>
xmlTreeParse("test.xml")
</code>
does not if this is called before the one above.
This is now fixed and was caused by
treating an xmlNodePtr in the C code
that had type XML_ELEMENT_DECL
and so was in fact an xmlElementPtr.
Aaah, C and casting!
</foo>
|