[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to use DTD and Schema in the single XML file?

From: Michael Kay <mike@saxonica.com>
Date: Tue, 25 Jul 2006 18:00:39 +0100
To: "'Balakrishnan'" <balakrishnan@alden.co.in>, "'Mukul Gandhi'" <gandhi.mukul@gmail.com>
Cc: <xmlschema-dev@w3c.org>
Message-ID: <013501c6b00b$db35c1e0$6401a8c0@turtle>
xml selective validation

> 
> I using DTD for parsing the XML file, Suppose the xml have 
> 100 elements and I want to validate just 10 element then How 
> can I write the schema? and validate?

There are not many tools that offer selective validation at the element
level, but you can do it with a schema-aware XQuery or XSLT 2.0 stylesheet:

<xsl:template match="element-to-be-validated">
  <xsl:copy-of select="." validation="strict"/>
</xsl:template>

Michael Kay
http://www.saxonica.com/
Received on Tuesday, 25 July 2006 17:00:48 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.