L
Lonewolf
Hi all,
please pardon me if this question is too trivial. I have an XML file
which stores data in base64. The schema is something like this,
<Remokon>
<Brand Name="SONY">
<Model Name="Type 1", Freq="2">
<Key ID="1" Len="42">
YR0RHhEOEQ0RHiENEg0RDhIMEg0hHRINEgwSDSIcEg0SDBINEg0R/4QA
</Key>
<Key ID="2" Len="38">
YhwSHRIMEg0yLBIMEwwSDRIMIhwTDBINEgwiHCINEhwSDRL/hAA=
</Key>
.....
</Model>
<Model Name="Type 2">
....
</Model>
</Brand>
<Brand Name="Philips>
....
</Brand>
....
</Remokon>
The value of the Key node stores binary data encoded using base64. I can
use .NET's XmlWriter and XmlReader to read and write with no issue. I
use a byte array to receive the decoded binary data, length is specified
by the len attribute of the key note.
As can be see, this seves as some kind of database which I would like to
query using XPath. Herein lies the question, how do I read the value o
fthe key node when I query for all the keys in a Brand's Model? My xpath
query is correct as I tried using string as the value adn it was able to
obtain the keys correctly. the query is something like SELECT all keys
where Brand="SONY" and Model="Type 1". Can someone please enlighten me
on how to use xpath's iterator to retrieve the value stored in Base64
encoded data and decode back into binary data based on the Len attribute
of the Key? I saw the iterator's Current.Value retrieves a string,
ValueAsLong, etc, but sadly no ValueAsBase64. XmlReader has a
ReadAsBase64 function which i used for reading the entire file. But
surely i won't want to use a SELECT * FROM * kind of query on a
database. Please can somebody enlighten me on this? Thank you so much
for your kind assistance on my query.
please pardon me if this question is too trivial. I have an XML file
which stores data in base64. The schema is something like this,
<Remokon>
<Brand Name="SONY">
<Model Name="Type 1", Freq="2">
<Key ID="1" Len="42">
YR0RHhEOEQ0RHiENEg0RDhIMEg0hHRINEgwSDSIcEg0SDBINEg0R/4QA
</Key>
<Key ID="2" Len="38">
YhwSHRIMEg0yLBIMEwwSDRIMIhwTDBINEgwiHCINEhwSDRL/hAA=
</Key>
.....
</Model>
<Model Name="Type 2">
....
</Model>
</Brand>
<Brand Name="Philips>
....
</Brand>
....
</Remokon>
The value of the Key node stores binary data encoded using base64. I can
use .NET's XmlWriter and XmlReader to read and write with no issue. I
use a byte array to receive the decoded binary data, length is specified
by the len attribute of the key note.
As can be see, this seves as some kind of database which I would like to
query using XPath. Herein lies the question, how do I read the value o
fthe key node when I query for all the keys in a Brand's Model? My xpath
query is correct as I tried using string as the value adn it was able to
obtain the keys correctly. the query is something like SELECT all keys
where Brand="SONY" and Model="Type 1". Can someone please enlighten me
on how to use xpath's iterator to retrieve the value stored in Base64
encoded data and decode back into binary data based on the Len attribute
of the Key? I saw the iterator's Current.Value retrieves a string,
ValueAsLong, etc, but sadly no ValueAsBase64. XmlReader has a
ReadAsBase64 function which i used for reading the entire file. But
surely i won't want to use a SELECT * FROM * kind of query on a
database. Please can somebody enlighten me on this? Thank you so much
for your kind assistance on my query.