tugwilson | 16 May 16:58
Picon
Favicon

Re: [groovy-user] XML processing with Groovy's different APIs


Jean-Noël Rivasseau-3 wrote:
> 
> My document looks like:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2
> 	http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core-1.2-strict.xsd">
> 
> I think this is correct. I am using DOMBuilder right now, how can I
> pass a parser having the validation property set to true?
> 
> I have tried:
> 
> 		def reader = new FileReader(file)
> 		def document = DOMBuilder.parse(reader, true false)
> 
> but it does not work (From the errors it looks like it is trying to
> validate against a DTD, which is not present).
> 
> 

Ah! so the document references an external DTD subset?

The parser will *always* read the DTD even if it's not validating. This is
because DTDs can contain information which are necessary for the correct
processing of the document (entity declarations, for example).

You are going to have to supply the DTD to the parser.

John Wilson

--

-- 
View this message in context: http://www.nabble.com/XML-processing-with-Groovy%27s-different-APIs-tp17274414p17276784.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane