yes, for example something like this:

    parser->setExternalSchemaLocation("http://anythingyoulike.com
C:/tmp/mySchema.xsd");

The first part is the namespace, ist has not to be a valid uri (as ist is
not resolved), the second has to be and describes the location of your
Schema-File.
I am sorry, by the way, because I am not talking about DTDs but schemas.

A corresponding schema could look like this:

<?xml version="1.0" encoding="ascii"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
           xmlns="http://anythingyoulike.com "
           targetNamespace="http://anythingyoulike.com "
           elementFormDefault="qualified">

  <xs:element name="FOLDER">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header" type="headerType"/>
         <xs:element name="entry" type="entryType" minOccurs="0"
maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
..........


> -----Ursprüngliche Nachricht-----
> Von:  Andreas B. Thun [SMTP:[EMAIL PROTECTED]
> Gesendet am:  Dienstag, 29. Juli 2003 14:40
> An:   [EMAIL PROTECTED]
> Betreff:      Re: AW: Validation with another DTD than specified in XML
> file
> 
> >          parserPtr->setExternalSchemaLocation( "SchemaID
> SchemaPath+Name" );
> 
> Thx! What is this schema ID? Can I write something like (see ?????)
> 
> 
>       // set validation scheme: Default for validation scheme is
> Val_Always
>       XercesDOMParser::ValSchemes valScheme = XercesDOMParser::Val_Always;
>       if (valSchemeStr == "never")
>               valScheme = XercesDOMParser::Val_Never;
> 
>       // create parser and do some settings
>       XercesDOMParser* parser = new XercesDOMParser();
>       parser->setDoSchema( true );
>       parser->setValidationScheme(valScheme);
>       parser->setDoNamespaces(false);
>       parser->setIncludeIgnorableWhitespace(false);
>       parser->setExternalSchemaLocation("x.dtd");  // ??????????
> 
>       // create an error handler and install it
>       DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter();
>       parser->setErrorHandler(errReporter);
> 
>       try {
>               parser->parse(xmlFile);
>       }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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

Reply via email to