W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2008

RE: suitable data type to store patterns..

From: Michael Kay <mike@saxonica.com>
Date: Thu, 10 Jan 2008 17:57:53 -0000
To: "'dave'" <ceek63@yahoo.com>, <xmlschema-dev@w3.org>
Message-ID: <013401c853b2$53645eb0$a500a8c0@turtle>

> I need to store some pattern values such as "[/<*ab^&[[1"  
> (excluding quotes) in XML. What would be the data type for an 
> element which would store such values as is?

xs:string. Of course, if there are any restrictions on the characters that
may appear, then you can use a type derived form xs:string by restriction.
But you haven't mentioned any such restrictions.

Of course, special characters such as "<" and "&" will have to be escaped as
in any well-formed XML document. The schema type doesn't affect that.
> 
> So that when I parse this element, I should be able to get 
> the raw value as is. 

> I guess I am referring to any Entity 
> translations occurring in this context.

I think this sentence may be the key to understanding your question, but I
really don't know what you mean by it. Schema validation is applied to the
content of elements and attribute after entity references have been
expanded. There is no way in the schema of constraining whether and where
entities can be used.

Michael Kay
http://www.saxonica.com/
Received on Thursday, 10 January 2008 17:58:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:01 GMT