RE: suitable data type to store patterns..

> 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 UTC