key attribute in xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • popprem
    New Member
    • Nov 2008
    • 19

    key attribute in xml

    hi,
    i created an xml schema with namespace like below.

    <xsd:schema
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace ="http://www.w3.org/2001/XMLSchema" elementFormDefa ult="qualified"
    attributeFormDe fault="unqualif ied" >

    but when i use key & keyref, it gives this warning :- "The 'http://www.w3.org/2001/XMLSchema:key' element is not supported in this context."

    what can be the problem?

    Can anyone please reply....
    Thanks in advance.

    this is how i specified key :

    <xsd:key name="PK_Counte rPartyCID" >
    <xsd:selector xpath=".//Counter_Party_C ID"/>
    <xsd:field xpath="CompID"/>
    </xsd:key>
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    just a question, what exactly is the context of your <key> (it's only allowed inside <element>)?

    regards

    Comment

    • popprem
      New Member
      • Nov 2008
      • 19

      #3
      thanks for the consideration.

      Can u please give me an example?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        example of what? one example of the <key> usage is here, others you will find searching google.

        regards

        Comment

        • popprem
          New Member
          • Nov 2008
          • 19

          #5
          thanks a lot
          I got it.

          Comment

          Working...