According to the Xerces features doc [1], set validation [2] and nonvalidating.load-external-dtd [3] features to "false" to turn off DTD/Schema validation/loading. I haven't tried this myself. so YMMV.

[1] http://xerces.apache.org/xerces2-j/features.html
[2] http://xerces.apache.org/xerces2-j/features.html#validation
[3] http://xerces.apache.org/xerces2-j/features.html#nonvalidating.load-external-dtd


Jake

At 03:42 AM 12/20/2006, you wrote:
>I do not know how to tell xerces to not follow a dtd.
>Note that a dtd does not only have validity stuff, but it
>can also define entities so turning of validation does not have
>to mean do not look at the dtd.
>
>I ran into a similar problem at work, and could be be
>bothered to figure out what magic I need to do
>to tell xerces not to follow the DTD, so I wrote a
>DtdFilter to filter out the DTD <!DOCTYPE> from
>the input string.
>
>Peter
>
>On 12/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> Quoting [EMAIL PROTECTED]:
>>
>> > any progress or workaround on that (for ant stable 1.6.5)?
>>
>> i've got this working, but at a snail's pace... not surprising since the
>> following is rather io intensive (as well as unidiomatic):
>>
>>   <taskdef resource="net/sf/antcontrib/antlib.xml"/>
>>   <taskdef name="jing"
>classname="com.thaiopensource.relaxng.util.JingTask" />
>>
>>   <for param="file">
>>     <path>
>>       <fileset casesensitive="false"
>>                dir="."
>>                id="xml.files"
>>                includes="**/*.xml"
>>       />
>>     </path>
>>
>>     <sequential>
>>       <jing rngfile="wellformed.rng" file="@{file}" failonerror="false" />
>>     </sequential>
>>   </for>
>>
>> you'll notice 2 optional tasks:
>>
>> - jing for an alternate well-formedness checker (specified in the relax-ng
>> file wellformed.rng). also using the undocumented jing attribute failonerror >> here, to stop jing from failing the build. however, just like xmlvalidate, it
>> stops processing after the first problem anyway, so we can't use a nested
>> fileset, but:
>>
>> - antcontrib and the <for> task to iterate over the lot
>>
>> i've got 400 xml files, and this took just short of 5 minutes, so about 1
>> second per file. xmllint did it near instantly.
>>
>> still hoping to hear of a better solution. anyone?
>>
>> - p
>>
>>
>> ---------------------------------------------------------------------
>> 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]
>
>
>

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

Reply via email to