Re: Designing an XML Input Doc for Application





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/
.



Relevant Pages

  • Re: XmlValidatingReader - just the FAQS?
    ... > read an xml file and an xsd file and validate the xml file using ... The XML schema is fine, and your instance document is valid by it, ... > Validation Error: The 'Name' element is not declared. ... The XmlSchema constructor should only appear in applications ...
    (microsoft.public.dotnet.xml)
  • Re: validating if a file is a true valid xml file that fits a cert
    ... ''' Validates an XML stream against the specified XML Schema. ... ValidateXmlFileException if the XML stream or XML Schema fails validation. ... Public Sub ValidateXmlFile(ByVal SchemaNamespace As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: xml schema
    ... Strict adherence to an XML standard (schema) must be done ... handle schema validation errors in production. ... .NET XML schema validation classes allow one to do incremental ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Trouble validating XML w/ XSD.
    ... For a root element node, if a schema matching the namespace if the element ... then lax validation kicks in according to XSD spec. ... > I've got the some code to try and validate some xml. ...
    (microsoft.public.dotnet.xml)
  • Re: What is the logic of storing XML in a Database?
    ... I thought XML was supposed to be used for transport? ... The validation ... schema describing that CSV file, for the simple reason that no such ... standard schema exists. ...
    (comp.databases.theory)