Jump to content

how to get element value instead attribute


grace123
 Share

how to get element value instead attribute  

  1. 1. how to get element value instead attribute

    • hi all,I have xml schema which is dataset type. there are following parts:
      0
    • ---------------------------
      0
    • <xs:element name="Receipt"> <xs:complexType> <xs:sequence> <xs:element name="Header"> <xs:complexType><xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="AlignContent" type="xs:string" use="optional" default="Left"/> <xs:attribute name="Italic" type="xs:boolean" use="optional" default="false"/> <xs:attribute name="Bold" type="xs:boolean" use="optional" default="false"/> </xs:extension> </xs:simpleContent></xs:complexType> </xs:element>
      0
    • ---------------------------
      0
    • the corresponding xml file part is :
      0
    • -----------------------------
      0
    • <Receipt>
      0
    • <Header AlignContent="left" Italic="false" Bold="false">1212</Header>
      0
    • -----------------------------I cannot get the value"1212",from ds.Tables[Receipt].Rows[0][Header],because "Header" is a table in dataset. If I try ds.Tables[Header].column[0], it got"AlignContent", if try ds.Tables[Header].column[6],I got Header_text, something like that....SO, how can i get the value"1212" from the these tables?Thanks a lot
      0


Recommended Posts

hi all,I have xml schema which is dataset type. there are following parts:---------------------------<xs:element name="Receipt"> <xs:complexType> <xs:sequence> <xs:element name="Header"> <xs:complexType><xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="AlignContent" type="xs:string" use="optional" default="Left"/> <xs:attribute name="Italic" type="xs:boolean" use="optional" default="false"/> <xs:attribute name="Bold" type="xs:boolean" use="optional" default="false"/> </xs:extension> </xs:simpleContent></xs:complexType> </xs:element> ---------------------------the corresponding xml file part is :-----------------------------<Receipt> <Header AlignContent="left" Italic="false" Bold="false">1212</Header> -----------------------------I cannot get the value"1212",from ds.Tables[Receipt].Rows[0][Header],because "Header" is a table in dataset. If I try ds.Tables[Header].column[0], it got"AlignContent", if try ds.Tables[Header].column[6],I got Header_text, something like that....SO, how can i get the value"1212" from the these tables?Thanks a lot

Link to comment
Share on other sites

What do you mean by "get the value"? XML Schema is for defining what's valid in an XML document, not "gathering" values from it, you know that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...