Re: Designing an XML Input Doc for Application
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Mon, 27 Mar 2006 17:57:09 +0200
joeslide wrote:
Assume an app has a set of input rules in an xml doc named rules.xml. A
user generates another xml doc (or fragment) named data.xml. What are
some ways I can validate data.xml with rules.xml without relying on a
external script to do the validation. I suppose you could use an
internal script (XHTML with Javascript), but can it be done with a DTD
Spec and XPath?
You need a validating parser and use that to validate data.xml against rules.xml (assuming rules.xml is a schema in a schema language the parser supports).
For W3C XML schemas an instance document (e.g. data.xml) can indicate schemas with the xsi:schemaLocation attribute (or xsi:noNamespaceSchemaLocation).
Some parsers have command line interfaces, some are integrated into XML editors, some have APIs to be used from various programming languages. If you do the validation from the command line or with an XML editor then you don't need script respectively your own program to perform the validation.
--
Martin Honnen
http://JavaScript.FAQTs.com/
.
- References:
- Designing an XML Input Doc for Application
- From: joeslide
- Designing an XML Input Doc for Application
- Prev by Date: Re: Designing an XML Input Doc for Application
- Next by Date: XSLT: how to mask {somethinglikethis} ?
- Previous by thread: Re: Designing an XML Input Doc for Application
- Next by thread: XSLT: how to mask {somethinglikethis} ?
- Index(es):
Relevant Pages
|