XML parser - error

2 views
Skip to first unread message

sylvi

unread,
Apr 21, 2007, 7:04:51 AM4/21/07
to NAVER based on OSG

Prof. Park

I want to use XML parser in nvXML.cpp to parse query result from
CAIM.
I stored the result in file and I parse the result using
nvXmlNode::parseFile().
But I got error when I try to parse the result. I dont understand what
causes the problem since the XML is correct.
If you have any idea please let me know.

Thank you.

sylvi

Here is the XML:
1. NO ERROR

<?xml version="1.0"?>
<sparql
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.w3.org/2005/sparql-results#" >
<head>
<variable name="name"/>
</head>
<results ordered="false" distinct="false">
<result>
<binding name="name">
<literal>AXIS 213 - 00408C6B159B</literal>
</binding>
</result>
<result>
<binding name="name">
<literal>HP459ABB</literal>
</binding>
</result>
</results>
</sparql>

2. ERROR (when I add more result)
<?xml version="1.0"?>
<sparql
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.w3.org/2005/sparql-results#" >
<head>
<variable name="name"/>
</head>
<results ordered="false" distinct="false">
<result>
<binding name="name">
<literal>AXIS 213 - 00408C6B159B</literal>
</binding>
</result>
<result>
<binding name="name">
<literal>HP459ABB</literal>
</binding>
</result>
<result>
<binding name="name">
<literal>AXIS 213 - 00408C6B0F68</literal>
</binding>
</result>
<result>
<binding name="name">
<literal>AXIS 210 - 00408C6F9DDA</literal>
</binding>
</result>
</results>
</sparql>

sylvi

unread,
Apr 21, 2007, 9:01:28 AM4/21/07
to NAVER based on OSG

Replying my previous message, I think I found what caused the error.
The XML parser in nvXML.cpp does not support parsing for the following
XML:
<root>
<child>value<child1>
...

PS. XXXX is text. (not in XML format)
In our XML configuration for NAVER, we always put value as a XML
attribut. <child name="value">
Therefore, we need to modify the parser to parse the result from CAIM
or ask ubicomp team to change the CAIM query result format.

Thank you,

sylvi

Reply all
Reply to author
Forward
0 new messages