Joined: 13 Jan 2015
Online Status: Offline
Posts: 12
Topic: Parsing an xml that is stored in a sql column Posted: 13 Jan 2015 at 2:00pm
Due to the nature of the content stored within my db, I cant reveal a few things, but I need to parse a xml. I looks like below (you can see where i censored). I am looking for the value within "current=___" which is within the first (highest) level of the xml code. and I need to pull it from each record in the database in relation to its unique ID. column 1 is unique id and column two is the xml column. anyone have any suggestions?? I'd appreciate any help.
<manifest xmlns:ver="a url i can't reveal" current=" the data i am looking for" ID=" a number i cant reveal and is useless" documenttype="a type i cant reveal" censoredCount="1">
<phase id= blah blah>
somemore sub sets of data
</phase>
<phase id= blah blah>
more sub sets of data
</phase>
</manifest>
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Posted: 16 Jan 2015 at 5:06am
are you passing the data as xml to the report, or are you getting xml from a field in the database?
if the former, just set the datasource to ado and cr will parse.
if the later, I would probably split using <, then look at the first array element for the word 'current' and grab everything after the =. Then I would probably split again on ", and just take the 1st data element..or 2nd, depends on how CR numbers the array elements.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Posted: 16 Jan 2015 at 5:10am
I don't think so. CR may have that ability, but I doubt. If you are storing text in a field, CR will see it as a string, so you would need to parse it that way.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum