Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xmlschema-dev] Entity

From: George Cristian Bina <george@---------.--->
To: Balakrishnan <balakrishnan@-----.--.-->
Date: 5/11/2006 10:45:00 PM
Hi Bala,

The document is valid against the schema. It depends how you invoke the 
validation, in this case you should make sure you do only XML Schema 
validation (not DTD validation) and you should specify the schema 
externally as the document does not refer it.
If you change the sample document like

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE root [
   <!ENTITY copy "sample">
]>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="sample.xsd">
      <test>this is the test &copy; node</test>
</root>

then you will have the schema referred by the document.

If you use XercesJ for validation for instance you can set the
http://java.sun.com/xml/jaxp/properties/schemaLanguage property to 
http://www.w3.org/2001/XMLSchema in order to validate against the XML 
Schema and not against the DTD.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


Balakrishnan wrote:
> Thanks George,
> 
> I have tried the below, but not working for me.
> 
> I have attached sample XML and XSD file for your reference. Could you advice
> where I am mistake.
> 
> Many thanks
> Bala
> 
> 
> -----Original Message-----
> From: George Cristian Bina [mailto:george@o...]
> Sent: Thursday, 11 May 2006 12:09
> To: Balakrishnan
> Cc: xmlschema-dev@w...
> Subject: Re: [xmlschema-dev] <none>
> 
> 
> Hi,
> 
> You need a DTD for entities. You can have something like below for instance:
> 
> <?xml version="1.0" encoding="utf-8" ?>
> <!DOCTYPE root [
>   <!ENTITY copy "sample">
> ]>
> <root>
>      <test>this is the test &copy; node</test>
> </root>
> 
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> www.---.com
> 
> 
> Balakrishnan wrote:
>> Dear All,
>>
>> I am new to Schema. I have more questions, first one here.
>>
>> How to declare the entities in the schema? Could you advice please.
>>
>> eg. XML
>> <?xml version="1.0" encoding="utf-8" ?>
>> <root>
>>     <test>this is the test &copy; node</test>
>> </root>
>>
>>
>> eg. Schema
>> <xsd:schema version='1.0'
>>  xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
>>  <xsd:element name='root'>
>>   <xsd:complexType>
>>    <xsd:sequence>
>>     <xsd:element name='test'/>
>>    </xsd:sequence>
>>   </xsd:complexType>
>>  </xsd:element>
>> </xsd:schema>
>>
>> Many thanks
>> Bala
>>
>> ------------------------------------------------------------------------
>>
>> <?xml version="1.0" encoding="utf-8" ?>
>> <!DOCTYPE root [
>>   <!ENTITY copy "sample">
>> ]>
>> <root>
>>      <test>this is the test &copy; node</test>
>> </root>
>>
>> ------------------------------------------------------------------------
>>
>> <?xml version='1.0' encoding='utf-8'?>
>> <xsd:schema version='1.0'
>>   xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
>>   <xsd:element name='root'> 
>>    <xsd:complexType>
>>     <xsd:sequence>
>>      <xsd:element name='test'/>    
>>     </xsd:sequence>   
>>    </xsd:complexType>
>>   </xsd:element>
>> </xsd:schema>

From skels@a... Fri May 12 20:33:15 2006
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1FeeK2-0005kE-UA


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent