hi, all. I stucked by the xml problem, I want to read out the data and
use the data to insert to database.

now I use the code:

  Dim formName As String
        formName = XmlDoc.SelectSingleNode("formTemplate/
formTempName").InnerText

I could get the formTemplate Name ‘abc’, but I also want to get the
Component Name "Button","Label" and "TextInput", and I also want to
get all the properties value of the
component. the xml data file I received is below.

my question now is that I could not loop out all the component Name,
and get all the properties values of the component accordingly.    can
anyone help me ? thanks in advance.

becaue I get the xml data in the runtime in the client side(flex
interface, design environment), I am using the editable region to
design the form template page, and get all the components in the
canvas and send it as xml data to server side to store it to the
table. I basically want use a 'for' loop to loop out all the component
Name ("Button","Label") ,and their properties.

 what I am doing is the template design IDE, it's something like
visual studio software development, the user could drag as many
components ("Button","Label","Image" and so on) as he wants to the
editable Canvas to form a page. So, I don't know exactly how many
components are on the Canvas(which will be sent to server side as xml
data) and different components have differenct properties("id","x","y"
and so on), so I use the code:

        Dim streamread As StreamReader

        Dim XmlDoc As XmlDocument = New XmlDocument()

        streamread = New StreamReader(Request.InputStream)

        XmlDoc.LoadXml(streamread.ReadToEnd)

To get the xml data, the xml data looks like the one I listed above
(but not fixed), but the xml data is not fixed data or properties, it
depends on different user to drag different components
('buttons','labels','Images') to the editable Canvas to form a
formTemplate page.
so, I think I must use a something like 'for' loop to get the
component Name and component properties.


my code : //it does not work
  Dim id As String
        Dim xAxis As String
        Dim yAxis As String
        Dim width As String
        Dim height As String
For Each node As XmlNodeList In XmlDoc.SelectNodes("formTemplate/
Component")
                   id = node.Item("id").InnerText
            xAxis = node.Item("x").InnerText
            yAxis = node.Item("y").InnerText
            width = node.Item("width").InnerText
            height = node.Item("height").InnerText
            If (node.FirstChild.Name = "Button") Then
               Dim label As String
               label = node.Item("label").InnerText
            End If
if(node.FirstChild.Name="Image") Then
Dim source As String
source = node.Item("source").InnerText
End If
        Next



this is my Xml data look like:

<formTemplate>
  <formTempName>abc</formTempName>
  <Component>
    <Button>
      <label>Button</label>
      <id>btn1</id>
      <x>141</x>
      <y>49</y>
      <width>65</width>
      <height>23</height>
    </Button>
    <Label>
      <text>New Label</text>
      <id>lbl2</id>
      <x>192</x>
      <y>123</y>
      <width>65</width>
      <height>23</height>
    </Label>
    <TextInput>
      <id>txtInput3</id>
      <x>237</x>
      <y>193</y>
      <width>160</width>
      <height>23</height>
    </TextInput>
  </Component>
</formTemplate>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to