Re: [xngr-user] schema service
Brought to you by:
edankert
From: Edwin D. <eda...@cl...> - 2003-02-21 11:28:42
|
Hello Rado, Thanks for your question. > I tried xngr and schema service. > When I press document->parse on xsd document, I get this error message: > Ln 3: cvc-elt.1: Cannot find the declaration of element 'xsd:schema'. If I'm correct, you are trying to parse a schema with the validation option turned on. There are 2 solutions: [1] Make sure you include the schema/dtd For validation to work you need to include a schema/dtd in your xml. DTD: To validate against a DTD, the DTD needs to be defined in the DOCTYPE element, like this: <!DOCTYPE test PUBLIC "http://test.org//1.0" "http://test.org/test.dtd"> SCHEMA: To validate the XML against the defined XML Schema, for a Schema without namespaces: <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://test.org/test.xsd"/> For a schema with namespaces: <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://test.org/ http://test.org/test.xsd" xmlns="http://test.org/"/> In this case, you could do this: <?xml version="1.0" encoding="windows-1250"?> <xsd:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> ........... </xsd:schema> [2] Turn validation off Turn the validation option off (Editor->Document->Validation), the XML will now only be checked for well-formedness. IMPORTANT: In contrary to what the reviews say, the application allows for editing and saving of non-valid/not well-formed XML. Hope this answered the question? Edwin |