Altova MapForce 2024 Enterprise Edition

Returns the local part of the name of node as an xs:string.

mf-func-xpath2-local-name2

 

Languages

XQuery, XSLT 2.0, XSLT 3.0.

 

Parameters

Name

Type

Description

node

node()

The input node.

 

Example

In the following XML file, the name of the p:product element is a prefixed qualified name (QName). The prefix "p" is mapped to the namespace "http://mycompany.com".

 

<?xml version="1.0" encoding="UTF-8"?>
<doc xmlns:p="http://mycompany.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="source.xsd">
  <p:product/>
</doc>

 

The following mapping extracts the local name, the name, and the namespace URI of the node and writes these values to a target file:

mf-func-xpath2-local-name-example

XSLT 2.0 mapping

The mapping output is displayed below. Each col item lists the result of the local-name, name, and namespace-uri functions, respectively.

 

<rows>
  <row>
    <col1>product</col1>
    <col2>p:product</col2>
    <col3>http://mycompany.com</col3>
  </row>
</rows>

© 2018-2024 Altova GmbH