Specifying the xsd:param value

Discussion in 'XML' started by spasala@gmail.com, Aug 18, 2006.

  1. Guest

    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
     
    , Aug 18, 2006
    #1
    1. Advertising

  2. Peter Flynn Guest

    wrote:
    > 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
    --
    XML FAQ: http://xml.silmaril.ie/
     
    Peter Flynn, Aug 20, 2006
    #2
    1. Advertising

  3. Guest

    Re: Specifying the xsd:param value

    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?



    wrote:
    > 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
     
    , Aug 21, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,167
    Markus
    Nov 22, 2005
  2. Geathaa
    Replies:
    2
    Views:
    717
    Geathaa
    Jul 30, 2003
  3. ectoplasm
    Replies:
    12
    Views:
    661
    Zorro
    Jul 28, 2005
  4. Specifying correct XSD in WSDL

    , Apr 7, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    113
  5. Dave
    Replies:
    5
    Views:
    728
    John Bokma
    Apr 26, 2011
Loading...

Share This Page