Alternative to using local-name()
Posted: Fri Aug 06, 2021 4:41 pm
Hi
Is there a way to get a value on root level not using "local-name()"? My problem is that my xslt are process by an engine that do not support "local-name()" (Don’t ask me why
)
I have loaded the file into a variable and I need to get the value cbc:ID on root level, but I only figure-out to get it by using:
<xsl:value-of select="$SupplierSeller//*[local-name()='TCOInformationDocument']/cbc:ID"/>
Lording of the file
<xsl:variable name="SupplierSeller" select="document(concat($rootFolder, '\InBound\Input-SupplierSeller.xml'))"/>
XML file
<TCOInformationDocument>
xmlns="urn:oasis:names:specification:ubl:schema:xsd:TCOInformationDocument-2.0.5"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
<cbc:ID>TCO-01</cbc:ID>
<cac:ReferencedContract>
<cbc:ID>1</cbc:ID>
</cac:ReferencedContract>
</TCOInformationDocument>
Any suggestions ?
Regards
Dan
Is there a way to get a value on root level not using "local-name()"? My problem is that my xslt are process by an engine that do not support "local-name()" (Don’t ask me why

I have loaded the file into a variable and I need to get the value cbc:ID on root level, but I only figure-out to get it by using:
<xsl:value-of select="$SupplierSeller//*[local-name()='TCOInformationDocument']/cbc:ID"/>
Lording of the file
<xsl:variable name="SupplierSeller" select="document(concat($rootFolder, '\InBound\Input-SupplierSeller.xml'))"/>
XML file
<TCOInformationDocument>
xmlns="urn:oasis:names:specification:ubl:schema:xsd:TCOInformationDocument-2.0.5"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
<cbc:ID>TCO-01</cbc:ID>
<cac:ReferencedContract>
<cbc:ID>1</cbc:ID>
</cac:ReferencedContract>
</TCOInformationDocument>
Any suggestions ?
Regards
Dan