Thread: [xngr-user] schema service
Brought to you by:
edankert
From: Rado K. <ra...@at...> - 2003-02-21 09:48:35
|
Hi, 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'. xsd: <?xml version="1.0" encoding="windows-1250"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> ........... </xsd:schema> Is there any way to resolve this problem? thanxs rado |
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 |
From: Rado K. <ra...@at...> - 2003-02-21 12:52:37
|
Hi Edwin, Thanks for your help. I have included schema in xml file. I replaced my code with 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> I got error message "Ln 6: cvc-elt.1: Cannot find the declaration of element 'xsd:schema'." for this : > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> ?? what is happen? thanks rado > 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 > > > > |
From: Edwin D. <eda...@cl...> - 2003-02-21 13:11:15
|
Hello Rado, > I have included schema in xml file. > > I replaced my code with 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> > > I got error message "Ln 6: cvc-elt.1: Cannot find the declaration of > element 'xsd:schema'." for this : > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > ?? what is happen? The thing that is happening here is that it can't find the file: http://www.w3.org/2001/XMLSchema.xsd Make sure that you are online when you are trying to validate the document. Please let me know about any other problems, Edwin |