[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Correct handling of namespaces with Sablotron?

Subject: Correct handling of namespaces with Sablotron?
From: Charles Turner <vze26m98@xxxxxxxxx>
Date: Mon, 16 Jan 2012 07:28:52 -0500
 Correct handling of namespaces with Sablotron?
Hi everyone-

I'm a newbie with respect to XML/XSLT, and am currently working on a
project to synchronize data between Adobe InDesign and Filemaker via
XML. I'm currently having trouble with the way I handle namespaces
importing to InDesign, where the internal XSLT processor is (I'm
pretty sure) Sablotron. (I believe Filemaker uses Xalan.) My current
solution works as I want with the libxslt/xsltproc that comes with OSX
Lion, but Sablotron/InDesign seems to add namespaces to the elements
I'm creating.

My examples are abbreviated to show the issue, but actually work.

Here's my original XML:

<?xml version="1.0" encoding="UTF-8"?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
	<PRODUCT BUILD="07-18-2011" NAME="FileMaker" VERSION="ProAdvanced 11.0v4"/>
</FMPXMLRESULT>

And here is the XSLT I've written:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmp="http://www.filemaker.com/fmpxmlresult" version="1.0"
exclude-result-prefixes="fmp">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  <xsl:template match="fmp:FMPXMLRESULT">
    <xsl:element name="FMPXMLRESULT"
namespace="http://www.filemaker.com/fmpxmlresult">
      <xsl:copy-of select="fmp:PRODUCT"/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

What I'd like to get back, in what is shown, is a simple an exact copy
of my input, but InDesign/Sablotron gives me:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns_1:FMPXMLRESULT xmlns:ns_1="http://www.filemaker.com/fmpxmlresult">
	<PRODUCT xmlns="http://www.filemaker.com/fmpxmlresult"
VERSION="ProAdvanced 11.0v4" NAME="FileMaker" BUILD="07-18-2011"/>
</ns_1:FMPXMLRESULT>

Where the output of <xsl:copy-from> is handled correctly (although an
xmlns attribute is added), but the output of <xsl:element> adds the
impromptu namespace of +ns_1;.

I've Googled and searched the list archives, and found one suggestive
thread, but so far no joy. Any pointers on Sablotron and or my lack of
understanding would be greatly appreciated.

Best wishes,

Charles Turner

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.