I am trying to read an XML with the UBL structure by means of JSON and Freemarker following some examples that I found in the network but still it does not manage to pass me the value and only throws me error. Here I leave the code.
----------- [XML] ------------
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<Comprobantes>
<Comprobante>
<informacionOrganismo>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent>
<sac:AdditionalInformation>
<sac:AdditionalMonetaryTotal>
<cbc:ID>0001</cbc:ID>
<cbc:PayableAmount currencyID="PEN">100.00</cbc:PayableAmount>
</sac:AdditionalMonetaryTotal>
<sac:AdditionalMonetaryTotal>
<cbc:ID>0002</cbc:ID>
<cbc:PayableAmount currencyID="PEN">0.00</cbc:PayableAmount>
</sac:AdditionalMonetaryTotal>
<sac:AdditionalMonetaryTotal>
<cbc:ID>0003</cbc:ID>
<cbc:PayableAmount currencyID="PEN">0.00</cbc:PayableAmount>
</sac:AdditionalMonetaryTotal>
<sac:AdditionalMonetaryTotal>
<cbc:ID>0004</cbc:ID>
<cbc:PayableAmount currencyID="PEN">0</cbc:PayableAmount>
</sac:AdditionalMonetaryTotal>
<sac:AdditionalProperty>
<cbc:ID>0005</cbc:ID>
<cbc:Value>CIEN SOLES</cbc:Value>
</sac:AdditionalProperty>
</sac:AdditionalInformation>
</ext:ExtensionContent>
</ext:UBLExtension>
</ext:UBLExtensions>
<cbc:UBLVersionID>2.0</cbc:UBLVersionID>
<cbc:CustomizationID>1.0</cbc:CustomizationID>
<cbc:ID>F001-00000001</cbc:ID>
<cbc:IssueDate>2018-08-06</cbc:IssueDate>
<cbc:InvoiceTypeCode>01</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>PEN</cbc:DocumentCurrencyCode>
<cac:AccountingSupplierParty>
<!--transaction.subsidiary.taxidnum-->
<cbc:CustomerAssignedAccountID>22222222222</cbc:CustomerAssignedAccountID>
<cbc:AdditionalAccountID>0</cbc:AdditionalAccountID>
<cac:Party>
<!-- legalname -->
<cac:PartyName>
<cbc:Name>Place</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:ID>555555</cbc:ID>
<cbc:StreetName>direccion 1</cbc:StreetName>
<cbc:CityName></cbc:CityName>
<cbc:CountrySubentity></cbc:CountrySubentity>
<cbc:District></cbc:District>
<cac:Country>
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Lugar 1 </cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cbc:CustomerAssignedAccountID>33333333333</cbc:CustomerAssignedAccountID>
<cbc:AdditionalAccountID>6</cbc:AdditionalAccountID>
<cac:Party>
<cac:PhysicalLocation>
<cbc:Description></cbc:Description>
</cac:PhysicalLocation>
<cac:PartyLegalEntity>
<cbc:RegistrationName>lugar 0 PE S.A</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="PEN">1000.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxAmount currencyID="PEN">1000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cac:TaxScheme>
<cbc:ID>0001</cbc:ID>
<cbc:Name>IGV</cbc:Name>
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:PayableAmount currencyID="PEN">1000.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="NIU">2</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="PEN">1000</cbc:LineExtensionAmount>
<cac:PricingReference>
<cac:AlternativeConditionPrice>
<!-- 1000.00 -->
<cbc:PriceAmount currencyID="PEN">1000.00</cbc:PriceAmount>
<cbc:PriceTypeCode>01</cbc:PriceTypeCode>
</cac:AlternativeConditionPrice>
</cac:PricingReference>
<!-- TAXRATE : 0.18 - 0.18 -->
<cac:TaxTotal>
<cbc:TaxAmount currencyID="PEN">1000.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxAmount currencyID="PEN">1000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:TaxExemptionReasonCode>10</cbc:TaxExemptionReasonCode>
<cac:TaxScheme>
<cbc:ID>1000</cbc:ID>
<cbc:Name>IGV</cbc:Name>
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:Item>
<cbc:Description>Item</cbc:Description>
<cac:SellersItemIdentification>
<cbc:ID>ITM0000001</cbc:ID>
</cac:SellersItemIdentification>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="PEN">1000</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="NIU">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="PEN">1000</cbc:LineExtensionAmount>
<cac:PricingReference>
<cac:AlternativeConditionPrice>
<!-- 1000.00 -->
<cbc:PriceAmount currencyID="PEN">1000.00</cbc:PriceAmount>
<cbc:PriceTypeCode>01</cbc:PriceTypeCode>
</cac:AlternativeConditionPrice>
</cac:PricingReference>
<!-- TAXRATE : 0.18 - 0.18 -->
<cac:TaxTotal>
<cbc:TaxAmount currencyID="PEN">1000.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxAmount currencyID="PEN">1000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:TaxExemptionReasonCode>10</cbc:TaxExemptionReasonCode>
<cac:TaxScheme>
<cbc:ID>1000</cbc:ID>
<cbc:Name>IGV</cbc:Name>
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:Item>
<cbc:Description>Item2</cbc:Description>
<cac:SellersItemIdentification>
<cbc:ID>ACC00001</cbc:ID>
</cac:SellersItemIdentification>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="PEN">1000</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
</Invoice>
<TextosLibres>
<TextoLibre1></TextoLibre1>
<TextoLibre2></TextoLibre2>
<TextoLibre3>Net 0</TextoLibre3>
</TextosLibres>
</informacionOrganismo>
</Comprobante>
</Comprobantes>
----------- [Template] ------------
<#ftl ns_prefixes={
"xmlns":"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2",
"cac":"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2",
"cbc":"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",
"ccts":"urn:un:unece:uncefact:documentation:2",
"ds":"http://www.w3.org/2000/09/xmldsig#",
"ext":"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2",
"qdt":"urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2",
"sac":"urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1",
"udt":"urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2",
"xsi":"http://www.w3.org/2001/XMLSchema-instance"}
>
{
"tranid": "${XML.Comprobantes.Comprobante.informacionOrganismo.Invoice[cbc:ID}",
}