Specifying the xsd:param value

S

spasala

Hello All,

I have an xml element namely


<csharpAttr>"[DllImport("user32.dll", SetLastError=false,
ExactSpelling=false)]"</csharpAttr>


the value of tha element could be anything for example


<csharpAttr>"[Conditional("DEBUG"), Conditional("TEST1")]"
</csharpAttr>


now I want to create a schema for this "charpAttr" element .
So the idea is the value should always start with a "[" and end with
"]"
So how do I specify the
pattern value
in the following


<xs:simpleType name="charpAttrType">
<xs:restriction base="xs:string">
<xs:pattern value= ???????/>
</xs:restriction>
</xs:simpleType>


Or if any body could suggest an alternate way (probably a better way)
that would be awesome.


Thanks in advance
sP
 
P

Peter Flynn

Hello All,

I have an xml element namely


<csharpAttr>"[DllImport("user32.dll", SetLastError=false,
ExactSpelling=false)]"</csharpAttr>


the value of tha element could be anything for example


<csharpAttr>"[Conditional("DEBUG"), Conditional("TEST1")]"
</csharpAttr>


now I want to create a schema for this "charpAttr" element .
So the idea is the value should always start with a "[" and end with
"]"

But it doesn't. Your first example starts and ends with a double-quote.
Your second example starts with a double-quote and ends with a newline
(white-space). If you declare the element content to start and end with
square brackets, both your examples will be invalid.

///Peter
 
S

spasala

Thanks Peter,

I think its just issue the way its displayed here in the groups. Both
my samples end with double quotes

<csharpAttr>"[DllImport("user32.dll", SetLastError=false,
ExactSpelling=false)]"</csharpAttr>

<csharpAttr>"[Conditional("DEBUG"), Conditional("TEST1")]">
</csharpAttr>.

Now how do I specify the pattern value?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top