Validating XML files during a transformation
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 67
- Joined: Thu Jan 24, 2008 4:52 pm
Validating XML files during a transformation
Is it possible to validate XML files during an XSL transformation before actually performing the transformations?
That is, I'd like to make sure the input XML file is valid before trying to process it.
I would know which schema to use.
Although the XML files should have been validated before the transformation, I can't guarantee it, so I'd like to make a check to verify them.
Is this possible with XSL?
If so, how?
Thanks, Mike
That is, I'd like to make sure the input XML file is valid before trying to process it.
I would know which schema to use.
Although the XML files should have been validated before the transformation, I can't guarantee it, so I'd like to make a check to verify them.
Is this possible with XSL?
If so, how?
Thanks, Mike
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Validating XML files during a transformation
Post by sorin_ristache »
Hello,
For DTD based validation of the XML input of the transformation use Saxon 9 to apply the transformation and enable the option DTD based validation of the source file in Options -> Preferences -> XML -> XSLT/FO/XQuery -> XSLT -> Saxon -> Saxon 9. For XML Schema based validation you need the schema-aware version of Saxon 9, that is Saxon 9 SA and you need to enable the option Schema based validation of the source file available in the same Preferences panel.
Regards,
Sorin
For DTD based validation of the XML input of the transformation use Saxon 9 to apply the transformation and enable the option DTD based validation of the source file in Options -> Preferences -> XML -> XSLT/FO/XQuery -> XSLT -> Saxon -> Saxon 9. For XML Schema based validation you need the schema-aware version of Saxon 9, that is Saxon 9 SA and you need to enable the option Schema based validation of the source file available in the same Preferences panel.
Regards,
Sorin
-
- Posts: 67
- Joined: Thu Jan 24, 2008 4:52 pm
Re: Validating XML files during a transformation
I was thinking of XML schema aware validation during XSLT transformations. Since we don't have Saxon 9SA, that option is out for the moment.
I had seen this web page:
http://www.ibm.com/developerworks/xml/l ... axslt.html
which uses
<xsl:import-schema schema-location="po1.xsd"/>
and then
<xsl:template match="document-node(schema-element(PurchaseOrder>
But their example set an option on the java command line in order to invoke the validation process.
After your comments, and more careful reading of the above web page, I notice that they're using Saxon 9SA also.
So, it appears that we can't do that now, but could do it if we were to obtain Saxon 9SA.
Thanks for your reply.
-- Mike
I had seen this web page:
http://www.ibm.com/developerworks/xml/l ... axslt.html
which uses
<xsl:import-schema schema-location="po1.xsd"/>
and then
<xsl:template match="document-node(schema-element(PurchaseOrder>
But their example set an option on the java command line in order to invoke the validation process.
After your comments, and more careful reading of the above web page, I notice that they're using Saxon 9SA also.
So, it appears that we can't do that now, but could do it if we were to obtain Saxon 9SA.
Thanks for your reply.
-- Mike
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Validating XML files during a transformation
Post by sorin_ristache »
Yes, you need a schema aware XSLT 2.0 processor for using xsl:import-schema, document-node(), schema-element(), etc.mlcook wrote:I had seen this web page:
http://www.ibm.com/developerworks/xml/l ... axslt.html
which uses
<xsl:import-schema schema-location="po1.xsd"/>
and then
<xsl:template match="document-node(schema-element(PurchaseOrder>
But their example set an option on the java command line in order to invoke the validation process.
After your comments, and more careful reading of the above web page, I notice that they're using Saxon 9SA also.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service