Discussion:
Prefixes on elements
(too old to reply)
Jan Eliasen
2006-02-24 11:49:22 UTC
Permalink
Hi

I have a customer, that needs to add prefixes in front of elements,
when using the BTF Assembler in a custom send pipeline. Basicually,
they have a customer that requires the prefixes to be present.

So, if anyone can help, that would be nice.

They are using Biztalk Server 2006 beta 2.

Here is how their document looks like :
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:biz="http://schemas.biztalk.org/btf-2-0/address/types">
- <SOAP-ENV:Header>
- <endpoints xmlns="http://schemas.biztalk.org/btf-2-0/endpoints"
SOAP-ENV:mustUnderstand="1">
- <to>
<address
xsi:type="biz:8c7d1ea0-7823-1000-b356-c0a87c200001">CustomerID</address>
</to>
- <from>
<address
xsi:type="biz:6db03db4-78e0-1000-b430-c0a8b4340001">SuppID</address>
</from>
</endpoints>
- <properties xmlns="http://schemas.biztalk.org/btf-2-0/properties"
SOAP-ENV:mustUnderstand="1">
<identity>uuid:4c6e79fb-2fb5-431b-a14d-eb00ccca18dc</identity>
<sentAt>2006-02-21T14:41:26+00:00</sentAt>
<expiresAt>2006-02-21T15:11:26+00:00</expiresAt>
<topic>root:Invoice</topic>
</properties>
<services xmlns="http://schemas.biztalk.org/btf-2-0/services"
SOAP-ENV:mustUnderstand="1" />
</SOAP-ENV:Header>
- <SOAP-ENV:Body>
Here goes our XML document (And it works)
</SOAP-ENV:Envelope>

And this is what it should have looked like :

- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2000/08/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
- <SOAP-ENV:Header
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <eps:endpoints SOAP-ENV:mustUnderstand="1"
xmlns:biz="http://schemas.biztalk.org/btf-2-0/address/types"
xmlns:eps="http://schemas.biztalk.org/btf-2-0/endpoints">
- <eps:to>
<eps:address xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:type="biz:OrganizationName">200922ac-78d0-1000-9d99-c0a8b4340001</eps:address>
</eps:to>
- <eps:from>
<eps:address xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:type="biz:OrganizationName">6db03db4-78e0-1000-b430-c0a8b4340001</eps:address>
</eps:from>
</eps:endpoints>
- <prop:properties SOAP-ENV:mustUnderstand="1"
xmlns:prop="http://schemas.biztalk.org/btf-2-0/properties">
<prop:identity>88B29821-0A27-472C-87E7-FB3A824FF0B8</prop:identity>
<prop:sentAt>2006-02-16T15:09:46+01:00</prop:sentAt>
<prop:expiresAt>2006-05-01T15:49:46+01:00</prop:expiresAt>
<prop:topic>root:Invoice</prop:topic>
</prop:properties>
</SOAP-ENV:Header>
<SOAP-ENV:Body />
Here goes our XML document (And it works)
</SOAP-ENV:Envelope>
--
Eliasen Jr. representing himself and not the company he works for.

Private email: ***@eliasen.dk

"Ford," he said, "you're turning into a penguin. Stop it."
WenJun Zhang[msft]
2006-02-27 09:43:39 UTC
Permalink
Hi Jan,

You should create custom pipeline component to append the prefixes on
elements.

In the pipeline code, you can use XslTransform class to perform XSLT
transformation. Below is an exmaple:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:book="http://example.com/2004/books">

<xsl:output method="xml" encoding="UTF-8" />

<xsl:template match="xhtml:* | /">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="*[namespace-uri() = '']">
<xsl:element name="{concat('book:', local-name())}"
namespace="http://example.com/2004/books">
<xsl:apply-templates select="@* | node()" />
</xsl:element>
</xsl:template>

<xsl:template match="@* | text() | processing-instruction() | comment()">
<xsl:copy />
</xsl:template>

</xsl:stylesheet>

Or you can use BizTalk 2004 mapper to generate XSLT for this and execute it
via XslTransform:

How do I reuse BizTalk 2004 maps outside of BizTalk?
http://blogs.msdn.com/gzunino/archive/2004/09/21/232629.aspx

Hope the info will be of some help.

Best regards,

WenJun Zhang
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Jan Eliasen
2006-03-01 06:50:38 UTC
Permalink
Post by WenJun Zhang[msft]
You should create custom pipeline component to append the prefixes on
elements.
Thanks for the answer! It helped a lot.
--
Eliasen Jr. representing himself and not the company he works for.

Private email: ***@eliasen.dk

"Ford," he said, "you're turning into a penguin. Stop it."
WenJun Zhang[msft]
2006-03-02 07:26:08 UTC
Permalink
You are welcome. Have a great day!

Best regards,

WenJun Zhang
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Leonid Ganeline
2006-02-27 21:00:32 UTC
Permalink
Hi Jan,
Is it working when use
the "Element FormDefault" schema property equal to Qualified?
--
Regards,

Leonid Ganeline
BizTalk developer
Vancouver
http://geekswithblogs.net/leonidganeline
===================================
Post by Jan Eliasen
Hi
I have a customer, that needs to add prefixes in front of elements,
when using the BTF Assembler in a custom send pipeline. Basicually,
they have a customer that requires the prefixes to be present.
So, if anyone can help, that would be nice.
They are using Biztalk Server 2006 beta 2.
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:biz="http://schemas.biztalk.org/btf-2-0/address/types">
- <SOAP-ENV:Header>
- <endpoints xmlns="http://schemas.biztalk.org/btf-2-0/endpoints"
SOAP-ENV:mustUnderstand="1">
- <to>
<address
xsi:type="biz:8c7d1ea0-7823-1000-b356-c0a87c200001">CustomerID</address>
</to>
- <from>
<address
xsi:type="biz:6db03db4-78e0-1000-b430-c0a8b4340001">SuppID</address>
</from>
</endpoints>
- <properties xmlns="http://schemas.biztalk.org/btf-2-0/properties"
SOAP-ENV:mustUnderstand="1">
<identity>uuid:4c6e79fb-2fb5-431b-a14d-eb00ccca18dc</identity>
<sentAt>2006-02-21T14:41:26+00:00</sentAt>
<expiresAt>2006-02-21T15:11:26+00:00</expiresAt>
<topic>root:Invoice</topic>
</properties>
<services xmlns="http://schemas.biztalk.org/btf-2-0/services"
SOAP-ENV:mustUnderstand="1" />
</SOAP-ENV:Header>
- <SOAP-ENV:Body>
Here goes our XML document (And it works)
</SOAP-ENV:Envelope>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2000/08/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
- <SOAP-ENV:Header
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <eps:endpoints SOAP-ENV:mustUnderstand="1"
xmlns:biz="http://schemas.biztalk.org/btf-2-0/address/types"
xmlns:eps="http://schemas.biztalk.org/btf-2-0/endpoints">
- <eps:to>
<eps:address xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:type="biz:OrganizationName">200922ac-78d0-1000-9d99-c0a8b4340001</eps:address>
</eps:to>
- <eps:from>
<eps:address xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:type="biz:OrganizationName">6db03db4-78e0-1000-b430-c0a8b4340001</eps:address>
</eps:from>
</eps:endpoints>
- <prop:properties SOAP-ENV:mustUnderstand="1"
xmlns:prop="http://schemas.biztalk.org/btf-2-0/properties">
<prop:identity>88B29821-0A27-472C-87E7-FB3A824FF0B8</prop:identity>
<prop:sentAt>2006-02-16T15:09:46+01:00</prop:sentAt>
<prop:expiresAt>2006-05-01T15:49:46+01:00</prop:expiresAt>
<prop:topic>root:Invoice</prop:topic>
</prop:properties>
</SOAP-ENV:Header>
<SOAP-ENV:Body />
Here goes our XML document (And it works)
</SOAP-ENV:Envelope>
--
Eliasen Jr. representing himself and not the company he works for.
"Ford," he said, "you're turning into a penguin. Stop it."
Jan Eliasen
2006-03-01 07:07:49 UTC
Permalink
On Mon, 27 Feb 2006 13:00:32 -0800, "Leonid Ganeline"
Post by Leonid Ganeline
Is it working when use
the "Element FormDefault" schema property equal to Qualified?
Hi

Thanks for your answer.

Yo uanswer appies to the schame of the document inside the envelope
and not to the envelope itself. So I don't think it will work. Anyway,
Wenjun's solution works fine, so we'll go with that one.
--
Eliasen Jr. representing himself and not the company he works for.

Private email: ***@eliasen.dk

"Ford," he said, "you're turning into a penguin. Stop it."
Loading...