|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with XML DOM? (XML Newbie)
Now that I've thought of a potential practical use for XML, I'm actually trying to implement it.
I've read through (skimmed, really) the PHP & XML articles on devshed, in the XML section... and I've been playing around with using the XML DOM, but have a few questions. My XML document looks something like this: Code:
<?xml version="1.0"?>
<SITE>
<SECTION1>
<PAGE1>This is the first page of section 1.</PAGE1>
<PAGE2>This is the second page of section 1.</PAGE2>
<PAGE3>This is the third page of section 1.</PAGE3>
</SECTION1>
<SECTION2>
<PAGE1>This is the first page of section 2.</PAGE1>
</SECTION2>
</SITE>
Now, I'm using the DOM to extract the root, and then list all of the children of the root. However, what's happening is that even though I have 2 children of the 'SITE' node, my code is reporting that there are more. I've checked the type for these other nodes, and they say they're text objects, but I can't figure out what they are. Here's my code: PHP Code:
The output looks like: Warning: Unexpected character in input: ' ' (ASCII=11) state=1 in c:\my documents\xml\testxml.php on line 45 The Document Root Tag is: SITE There are 5 children to the Document Root Tag.
So my first question is, why am I getting that 'Unexpected character in input' error? Secondly, what are those three other 'objects'? What are they used for? Can anyone help me out? Thanx, - coredumped. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Help with XML DOM? (XML Newbie) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|