Hi,

I am relatively inexperienced in working with Xerces and I am having a little trouble 
getting across the finish line with my current problem. I am developing with the 
Xerces 1.6.0 distribution and my XML has the following structure:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Catalog SYSTEM "http://mydomain.com/items.dtd";>
<ItemList>
  <Item ID="id1">
    <Itemfield Name="name1" Value="val1" />
    <Itemfield Name="name2" Value="val2" />
    <Itemfield Name="name3" Value="val3" />
  </Item>
  <Item ID="id2">
    <Itemfield Name="name1" Value="val1" />
    <Itemfield Name="name2" Value="val2" />
    <Itemfield Name="name3" Value="val3" />
  </Item>
</ItemList>


I have a two part question:

1) The DOMParser::parser->parse() method is failing since it does not have access to 
the DTD file (note DTD is not local and I cannot retrieve it via http on the fly). 
Assuming I can't change the XML structure, can I tell the parser to ignore the DTD so 
I can continue to process the XML?

2) I remove the DTD line from the XML and I can parse it. I use 
getElementsByTagName("Item") to get a list of DOM_Nodes for each Item tag. I want to 
look for a particular Item ID and return the entire string (representing that 
node/tag) if the ID matches what I am looking for. However, I can't seem to find a 
method/property in the DOM_Node class to do this. To clarify, if I am looking for Item 
ID="id1", I want to return this string:

  <Item ID="id1">
    <Itemfield Name="name1" Value="val1" />
    <Itemfield Name="name2" Value="val2" />
    <Itemfield Name="name3" Value="val3" />
  </Item>


I know this is an easy question but I just can't seem to get it working correctly. Any 
help would be greatly appreciated...

TIA,

--Hieu


Need a new email address that people can remember
Check out the new EudoraMail at
http://www.eudoramail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to