XSLT with namespace causing an issue

sebbiO

New Member
I want to grab "LIVE" out of the XML below. I've read similar posts and have been using the local-name() function as a result, but no matter what XSLT I use I can't get it.\[code\]<?xml version="1.0"?><cns:customer xmlns:cns="https://services.cns.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://services.cns.com docs/xsd/customer.xsd"> <cns:userId>1001</cns:userId> <cns:status>LIVE</cns:status> <cns:type wholesale="true" suspended="false">W1</cns:type> <cns:properties> <cns:property> <cns:name>Name</cns:name> <cns:value>Bob</cns:value> </cns:property> </cns:properties></cns:customer>\[/code\]Here is the XSLT I am using.\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="UTF-8"/> <xsl:template match="//*[local-name()='status']/text()"> <xsl:value-of select="."/> </xsl:template></xsl:stylesheet>\[/code\]I am testing using Oxygen application. I think the processor is Saxon 6.5.5.The output I get is:\[code\]1001LIVEW1 Name Bob\[/code\]Thanks,Paul
 
Back
Top