Jump to content
Sign in to follow this  
grace123

how to get value of element which has attributes

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

Share this post


Link to post
Share on other sites

From your post it's very difficult to tell exactly what you're trying to do! But it sounds like a .NET dataset so hopefully this link will help: http://samples.gotdotnet.com/quickstart/ho...SetXMLData.aspxIt has an example of reading XML schema and data into a dataset, and then displaying the resulting data from the dataset.Hope this helps.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...