[Templates] XML::XPath $path wildcard-ing

[prev] [thread] [next] [Date index for 2005/05/11]

From: Roderick A. Anderson
Subject: [Templates] XML::XPath $path wildcard-ing
Date: 23:19 on 11 May 2005
Suddenly ( I'm sure I haven't changed anything :-) a getNodeText call 
isn't working the way I thought it was.  Are there any examples of 
different $path values and are there wildcards?

I have a document that comes back _mostly_ like this:

  <Response id="XCRA" ... >
    <Body>
      <CreateCustomerResponse>
        <Failed>
          <Fault>
            <faultcode>Fault.CCProcessor.Authorization.Failed</faultcode>
            <faultstring>Credit Card Authorization failed</faultstring>
          </Fault>
          <NativeError Type="ErrorCode">-1</NativeError>
          <NativeError Type="ErrorMessage">This transac ... </NativeError>
        </Failed>
      </CreateCustomerResponse>
    </Body>
  </Response>

( with all the xmlns' removed )

I was doing a , with all the proper magic before ,

  my $Failed = $xs->getNodeText( '/Failed' );

Now it seems I get nothing back.  Do I have to know the full document 
structure ( since I want use this in other scripts ) or can I do some 
wildcard type of thingy?

I have used a little later in the script a :

  $faultstring = $xs->getNodeText( '//faultstring' );

and that did work but I'm now hung up at the first test.  Yes I can -- and 
will -- test but having a hint on the wild card possiblities will help.


Rod
        -- 
            "Open Source Software - You usually get more than you pay for..."
     "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"



_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] XML::XPath $path wildcard-ing
Roderick A. Anderson 23:19 on 11 May 2005

Generated at 07:01 on 17 May 2005 by mariachi v0.52