K
Kent Ogletree
I seem to still be stuck a bit on getting started with XMLTextReader which
seem to be exactly what I need. I retrieve a fragment of data from a
database field, an example of which is (I have no control over how it is
formatted or structured):
<qMultipleChoice>
<qText>What workstation are you working at?</qText>
<qChoice>1</qChoice>
<qChoice>2</qChoice>
<qChoice>3</qChoice>
<qChoice>4</qChoice>
<qChoice>5</qChoice>
<qChoice>7</qChoice>
<qChoice>8</qChoice>
<qChoice>9</qChoice>
<qChoice>Other</qChoice>
</qMultipleChoice>
I can loop through it using the XMLTextReader and see the names of the
elements with reader.Name, getting
qMultipleChoice
qText
qChoice
qChoice......etc.
However I can not get the values. reader.value seems to return nothing. I
need to get the name of each element and the values and take certain
formatting and structure actions based on the names. I tried
reader.ReadElementString, but then I can not apparently see what the name
is. Can anyone loan me a clue-by-4 on how to get the value and names? I know
I am missing something.
Kent
seem to be exactly what I need. I retrieve a fragment of data from a
database field, an example of which is (I have no control over how it is
formatted or structured):
<qMultipleChoice>
<qText>What workstation are you working at?</qText>
<qChoice>1</qChoice>
<qChoice>2</qChoice>
<qChoice>3</qChoice>
<qChoice>4</qChoice>
<qChoice>5</qChoice>
<qChoice>7</qChoice>
<qChoice>8</qChoice>
<qChoice>9</qChoice>
<qChoice>Other</qChoice>
</qMultipleChoice>
I can loop through it using the XMLTextReader and see the names of the
elements with reader.Name, getting
qMultipleChoice
qText
qChoice
qChoice......etc.
However I can not get the values. reader.value seems to return nothing. I
need to get the name of each element and the values and take certain
formatting and structure actions based on the names. I tried
reader.ReadElementString, but then I can not apparently see what the name
is. Can anyone loan me a clue-by-4 on how to get the value and names? I know
I am missing something.
Kent