You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Troels Rossing <tr...@qualiware.com> on 2002/12/19 16:09:52 UTC
problems with namespaces
Hi
I am trying to parse a XML document that looks like the following
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
</D:response>
</D:multistatus>
my code looks like this
LoadDOMDocument(char *File)
{
DOMParser Parser;
QWErrorHandler* errorHandler = new QWErrorHandler();
Parser.reset();
Parser.setErrorHandler(errorHandler);
Parser.setDoValidation(true);
Parser.setDoNamespaces(true);
Parser.setDoSchema(true);
// Parser.setValidationSchemaFullChecking(true);
Parser.parse(File);//
I get an error like this from the parser
Attribute '{http://www.w3.org/2000/xmlns/}D' is not declared for element
'D:multistatus'
I want to use XPath (Xalan) on the XML, if I set doValidation(false)
then it loads fine, but what causes the error??
Please any help is very welcome
Regards
Troels Rossing
www.Qualiware.com
Re: problems with namespaces
Posted by Alberto Massari <al...@exln.com>.
At 16.09 19/12/2002 +0100, Troels Rossing wrote:
>Hi
>
>I am trying to parse a XML document that looks like the following
>
><?xml version="1.0" encoding="UTF-8"?>
><D:multistatus xmlns:D="DAV:">
> <D:response>
> </D:response>
></D:multistatus>
>
>[...]
>I get an error like this from the parser
>
>Attribute '{http://www.w3.org/2000/xmlns/}D' is not declared for element
>'D:multistatus'
>
>I want to use XPath (Xalan) on the XML, if I set doValidation(false) then
>it loads fine, but what causes the error??
Hi Troels,
given your XML document, you must disable validation; you would not get any
error is the XML contained a reference to a DTD.
Alberto
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org