Element of XML

EhernandezEhernandez Member Posts: 3
Hi, I need help, I try read a xml document but i dont have idea how I can obtain the text of a Element, I have the next xml
I use NAV 2016.
<?xml version="1.0"?>
<Acuse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" RfcEmisor="FLI081012K2" Fecha="2011-05-04T18:02:32.5834309">
  <Folios xmlns="http://cancelacfd.sat.gob.mx">
    <UUID>EC71541D-7E57-7E57-7E57-58B200D42</UUID>
    <EstatusUUID>202</EstatusUUID>
  </Folios>
  <Signature Id="SelloSAT" xmlns="http://www.w3.org/2000/09/xmldsig#">
    <SignedInfo>
      <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
      <SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#hmac-sha512" />
      <Reference URI="">

I like obtain the value of <UUID> and save a Text Variable,
I use this for the attributes
rutasencilla:='F:\NAV2016\CANCELADO-FE-FACMX907.xml';
XMLDoc.Load(rutasencilla);
NamespaceManager := NamespaceManager.XmlNamespaceManager(XMLDoc.NameTable);
//http://cancelacfd.sat.gob.mx
NamespaceManager.AddNamespace('folios','http://cancelacfd.sat.gob.mx');
NamespaceManager.AddNamespace('Acuse','http://www.w3.org/2001/XMLSchema-instance');
XMLCurrNode := XMLDoc.SelectSingleNode('Acuse',NamespaceManager);
XMLDOMNamedNodeMap := XMLCurrNode.Attributes;
XMLCurrNode := XMLDOMNamedNodeMap.GetNamedItem('Fecha');
MESSAGE(FORMAT(XMLCurrNode.Value));

thanks for the help :smile:

Answers

  • CailleanCaillean Member Posts: 36
    Try:

    XMLCurrNode.Text instead of XMLCurrNode.Value

    That should help.
Sign In or Register to comment.