I have trouble with namespace. I need this output:
<xyt:arguments xmlns:xyt="urn:xytechsystems.com/XytechAPI"
xmlns:NS1="http://schemahost.amcnetworks.com:8080/amcnesb/schemas">
but have trouble with add this namespace xmlns:xyt="urn:xytechsystems.com/XytechAPI" to the argument I tried used xsl:namesapce, but think trouble in inherit with node my xslt:
?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:amc="http://schemahost.amcnetworks.com:8080/amcnesb/schemas/adam"
xmlns:my="http://tempuri.org/dummy"
xmlns:i ="http://www.w3.org/2001/XMLSchema-instance"
xmlns:NS1="http://schemahost.amcnetworks.com:8080/amcnesb/schemas" exclude-result-prefixes="#all"
version="3.0">
<xsl:output method="xml" encoding="UTF-8" version="1.0" indent="yes"/>
<xsl:element name="soapenv:Envelope" >
<xsl:namespace name="i" select="'http://www.w3.org/2001/XMLSchema-instance'"/>
<xsl:namespace name="xyt1"
select="'http://schemas.datacontract.org/2004/07/Xytech.MP.API'"/>
<xsl:namespace name="xyt" select="'urn:xytechsystems.com/XytechAPI'"/>
<xsl:element name="soapenv:Header"/>
<xsl:element name="soapenv:Body"/>
<xsl:element name="xyt:Upsert">
<xsl:element name="xyt:credentials">
</xsl:element>
<xsl:element name="xyt:arguments">
<xsl:namespace name="xyt" select="urn:xytechsystems.com/XytechAPI">
<xsl:namespace name="NS1"
select="'http://schemahost.amcnetworks.com:8080/amcnesb/schemas'"/>
my output:
<soapenv:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xyt1="http://schemas.datacontract.org/2004/07/Xytech.MP.API"
xmlns:xyt="urn:xytechsystems.com/XytechAPI"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body/>
<xyt:Upsert>
<xyt:credentials/>
<xyt:arguments xmlns:NS1="http://schemahost.amcnetworks.com:8080/amcnesb/schemas">
<xsl:namespace name="xyt" select="'urn:xytechsystems.com/XytechAPI'"/>
xytnamespace is already declared on thesoapenv:Envelopeancestor, so it will be in scope. Are you trying to make it show up explicitly on thexyt:argumentselement? Also, in your example, you don't have the namespace in single quotes in your @select when attempting to redefine thatxytnamespace, so I would expect it to either error out or select nothing.