I ran across a problem of namespace parsing in Xerces C v2.1 on Windows. Any
input to why it happens is greatly appreciated.  

It seems that it doesn't like default namespace specified in root element.  

 see line <Signature xmlns="http://www.w3.org/2000/09/xmldsig#";> in below

The modified DOMPrint example give me exception error code 14 when I parse
the xml doc.

The modified DOMPrint example has the following parser setting 
...

    XercesDOMParser *parser = new XercesDOMParser;

                parser->setValidationScheme(XercesDOMParser::Val_Auto);
                parser->setDoValidation(false);
                parser->setDoNamespaces(true);
                parser->setDoSchema(true);
                parser->setValidationSchemaFullChecking(true);
                parser->setCreateEntityReferenceNodes(false);

Here is the input file.
======================

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Signature SYSTEM "my.dtd">
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#";>
  <SignedInfo>
    <CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
    <SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <Reference URI="myObj">
      <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
      <DigestValue>dTfs7EELdLYyqn9dIQ6foCilcII=</DigestValue>
    </Reference>
  </SignedInfo>
 
<SignatureValue>J7DjYRRvVOZuM99zaKtzPXXYSwqYn1mElNgMG3xGqR1krI7egJTQ/OKmprrk
2z9g</SignatureValue>
<Object Id="myObj"><Book>
 <Title>Java and XML</Title>
 <Contents>
  <Chapter id="chapter1">
    <Heading>Introduction</Heading>   
    <Topic subSections="7">What Is It?</Topic>
    <Topic subSections="3">How Do I Use It?</Topic>
    <Topic subSections="4">Why Should I Use It?</Topic>
    <Topic subSections="0">What&apos;s Next?</Topic>
  </Chapter>

  <SectionBreak/>

  <Chapter focus="XML">
    <Heading>Creating XML</Heading>
    <Topic subSections="0">An XML Document</Topic>
    <Topic subSections="2">The Header</Topic>
    <Topic subSections="6">The Content</Topic>
    <Topic subSections="1"/>
  </Chapter>

 </Contents>

</Book></Object></Signature>

=====================
Here is my.dtd

 <<my.dtd>> 
=================

If I change the line

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#";>

to 

<t:Signature xmlns:t="http://www.w3.org/2000/09/xmldsig#";>

and line

</Book></Object></Signature>

to 

</Book></Object></t:Signature>

DOMPrint parses and prints the xml file OK.

-D



Attachment: my.dtd
Description: Binary data

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

Reply via email to