You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Veerappan Saravanan-ESV007 <es...@motorola.com> on 2004/04/23 16:36:46 UTC

Well formed & valid document

How can I validate a valid XML document that does not have reference to schema?

<A>
  <B name="john">Text goes here</B>
</A>

Here is  the schema I want to validate with the above xml

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:element name="A">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="B"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="B">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string">
					<xs:attribute name="name" type="xs:string" use="required"/>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
</xs:schema>


Thanks,
-Saravanan


Re: Well formed & valid document

Posted by Martin Vysny <vy...@sozo.fns.uniba.sk>.
Veerappan Saravanan-ESV007 wrote:

>
> How can I validate a valid XML document that does not have reference 
> to schema?
>
> <A>
>   <B name="john">Text goes here</B>
> </A>
>
You can use Sun's MSV, just google the MSV string.

Martin Vysny


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Well formed & valid document

Posted by Bob Foster <bo...@objfac.com>.
Veerappan Saravanan-ESV007 wrote:

> 
> How can I validate a valid XML document that does not have reference to 
> schema?
> 
> <A>
>   <B name="john">Text goes here</B>
> </A>

Set the 
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation 
  property.

Bob Foster


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Well formed & valid document

Posted by Neil Delima <nd...@ca.ibm.com>.



Veerappan Saravanan-ESV007 <es...@motorola.com> wrote on 04/23/2004
10:36:46 AM:

> How can I validate a valid XML document that does not have referenceto
schema?


You can either use:
1) Xerces properties
http://apache.org/xml/properties/schema/external-schemaLocation and
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
[1].
2) JAXP properties
{"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema"} and
{"http://java.sun.com/xml/jaxp/properties/schemaLocation", "test.xsd"}
3) DOM Level 3 LS configuration parameters:
{"schema-type", "http://www.w3.org/2001/XMLSchema"} and
{"schema-location", "test.xsd"}

[1] http://xml.apache.org/xerces2-j/properties.html
[2] http://java.sun.com/xml/downloads/jaxp.html
[3] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org