Re: string extraction

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Draku,

What is it that makes it "pseudo xml"? It looks like XML without a root
element. Why not just encapsulate everything in a root element and then
parse it in an XML document?

Then you can use XPath and whatnot to get your values.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"draku" <drakuu@xxxxxxxxx> wrote in message
news:1147897903.251255.10580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I'm working on credit card processing gateway and the result of the
transaction is returned as pseudo XML! Nope not real XML. Any way the
"XML" looks like that:
<r_csp></r_csp>
<r_time>Wed May 17 13:04:13 2006</r_time>
<r_ref></r_ref>
<r_error>SGS-002304: Credit card is expired.</r_error>
<r_ordernum>420BC82C-446B73AD-248-B918E</r_ordernum>
<r_message></r_message>
<r_code></r_code>
<r_tdate></r_tdate>
<r_score></r_score>

I need to pars the code and extract the values. I can't really find a
good way of doing it. Since the number of values may change I would not
like to refer to them as value[1]... but rather r_error = value of
r_error.

Any hints? All help highly appreciated.
drakuu



.



Relevant Pages

  • Re: Editing XML
    ... I wonder how text and child nodes are distinguished in the XML text. ... The first is the processing instruction, which you'll typically ignore in XSLT. ... THe next is the element node named "tag" and the last is the text node. ... There is always exactly one root element in a valid XML document. ...
    (comp.lang.pascal.delphi.misc)
  • newbie: writing to xml and namespaces
    ... I'm having some issues when programmatically editing an XML file. ... XmlTextWriter and add the default namespace declaration when writing the ... appears other than in the root element. ...
    (microsoft.public.dotnet.languages.csharp)
  • Missing namespace in XML serialization
    ... We generated a VB wrapper class of this schema using the XSD.exe tool: ... Public Class Response ... Serializing an instance of Response class (defined as root element in the ... schema) we can obtain an XML document that correctly shows the namespace ...
    (microsoft.public.dotnet.xml)
  • Re: XML from SQL
    ... I have read ALOT on XML over the last few weeks. ... element and the namespace but I was having problems including the ... To fix the problem you could consider to create the root element on the ... since MS SQL Server 2005 you can use ...
    (microsoft.public.sqlserver.xml)
  • Re: XML from SQL
    ... I have read ALOT on XML over the last few weeks. ... element and the namespace but I was having problems including the ... To fix the problem you could consider to create the root element on the ... since MS SQL Server 2005 you can use ...
    (microsoft.public.sqlserver.xml)