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

Embedded Stylesheet : namespace problem

Subject: Embedded Stylesheet : namespace problem
From: Ronald Kent Gibson <Kent.Gibson@xxxxxxxxxxx>
Date: Wed, 11 Feb 2004 14:42:38 +0100
reference initials
hello,

I have a styleseet with an embedded xml file.

I have defined a name space called icon and that is the namespace of my
embedded xml. I also have a name space for xls & fo defined.

The problem is that some other application, (when the xml is not embedded)
couphs up on the name space. So I want to use the following stylesheet as it
is, but I want the embedded xml, which is rooted at the <LETTER> element to
use no namespace.

When I remove xmlns:icon="http://www.icongmbh.de/letter" from the stylesheet
definition and xmlns="http://www.icongmbh.de/letter" from the root
definition and icon: from all the xpath querys it doesn't work. It say that
LETTER is an unexpected child.

I am sure I am doing something silly.

anyone got any ideas?

thanks

kent

begin sylesheet
**************************************************
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:icon="http://www.icongmbh.de/letter">
	<LETTER xmlns="http://www.icongmbh.de/letter">
		<CLOSING>Sincerely</CLOSING>
		<DATE DAY="28" MONTH="September" YEAR="1999"/>
		<ENCLOSURE/>
		<REFERENCE>Something here</REFERENCE>
		<RETURN-ADDRESS>
			<STREET>Bimsarkstr 56</STREET>
			<CITY>Suttgart</CITY>
			<STATE>Baden</STATE>
			<ZIP>70197</ZIP>
		</RETURN-ADDRESS>
		<SIGNATURE>
			<NAME>
				<FIRST-NAME>Doug</FIRST-NAME>
				<LAST-NAME>Tidwell</LAST-NAME>
			</NAME>
			<JOB-TITLE>Senior Programmer</JOB-TITLE>
		</SIGNATURE>
		<INSIDE-ADDRESS>
			<NAME>
				<TITLE>Mrs.</TITLE>
				<FIRST-NAME>Mary</FIRST-NAME>
				<LAST-NAME>McGoon</LAST-NAME>
			</NAME>
			<STREET>1401 Main Street</STREET>
			<CITY>Anytown</CITY>
			<STATE/>
			<ZIP>34829</ZIP>
		</INSIDE-ADDRESS>
		<COMPANY>IBM</COMPANY>
		<ATTENTION/>
		<BODY>
			<PARA>
      It was a pleasure to meet you at XML World '99 
      in Ottawa recently.  As promised, I'm enclosing 
      a copy of the "Intro to XML" tutorial CD.  I 
      apologize that we were out of CDs when you stopped
      by our booth.  
    </PARA>
			<PARA>
      Please let me know if you have any comments on the
      tutorial, or if you have suggestions for future 
      topics.  Over the next few months, we'll be adding
      new tutorials to the developerWorks web site 
      (www.ibm.com/developerWorks).  We'd really like
      your feedback!
    </PARA>
		</BODY>
	</LETTER>
	<xsl:template match="xsl:stylesheet">
		<xsl:apply-templates select="icon:LETTER"/>
	</xsl:template>
	<xsl:template match="icon:LETTER">
		<xsl:processing-instruction
name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
			<fo:layout-master-set>
				<fo:simple-page-master master-name="main"
page-width="21.0cm" page-height="29.7cm" margin-top="75pt"
margin-bottom="75pt" margin-left="75pt" margin-right="75pt">
					<fo:region-body
margin-bottom="75pt"/>
				</fo:simple-page-master>
			</fo:layout-master-set>
			<fo:page-sequence master-reference="main">
				<fo:sequence-specification>
					<fo:sequence-specifier-alternating
page-master-first="main" page-master-odd="main" page-master-even="main"/>
				</fo:sequence-specification>
				<fo:flow>
					<fo:table space-before="6pt">
						<fo:table-column
column-width="225pt"/>
						<fo:table-column
column-width="250pt"/>
						<fo:table-body>
							<fo:table-row
space-before="3pt">
	
<fo:table-cell>
	
<fo:block>   </fo:block>
	
</fo:table-cell>
	
<fo:table-cell>
	
<xsl:apply-templates select="icon:COMPANY"/>
	
<xsl:apply-templates select="icon:RETURN-ADDRESS"/>
	
</fo:table-cell>
							</fo:table-row>
							<fo:table-row
space-before="3pt">
	
<fo:table-cell>
	
<fo:block>  </fo:block>
	
</fo:table-cell>
	
<fo:table-cell>
	
<xsl:apply-templates select="icon:DATE"/>
	
</fo:table-cell>
							</fo:table-row>
						</fo:table-body>
					</fo:table>
					<xsl:apply-templates
select="icon:INSIDE-ADDRESS"/>
					<xsl:apply-templates
select="icon:SUBJECT"/>
					<xsl:apply-templates
select="icon:ATTENTION"/>
					<xsl:apply-templates
select="icon:SALUTATION"/>
					<xsl:apply-templates
select="icon:BODY"/>
					<fo:table space-before="6pt">
						<fo:table-column
column-width="225pt"/>
						<fo:table-column
column-width="250pt"/>
						<fo:table-body>
							<fo:table-row
space-before="3pt">
	
<fo:table-cell/>
	
<fo:table-cell>
	
<xsl:apply-templates select="icon:CLOSING"/>
	
</fo:table-cell>
							</fo:table-row>
							<fo:table-row
space-before="3pt">
	
<fo:table-cell/>
	
<fo:table-cell>
	
<xsl:apply-templates select="icon:SIGNATURE"/>
	
</fo:table-cell>
							</fo:table-row>
						</fo:table-body>
					</fo:table>
					<xsl:apply-templates
select="icon:ENCLOSURE"/>
					<xsl:apply-templates
select="icon:CC-LIST"/>
					<xsl:apply-templates
select="icon:REFERENCE-INITIALS"/>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>
	<xsl:template match="icon:COMPANY">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start">
			<xsl:apply-templates/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:SIGNATURE">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" text-align-last="start">
			<xsl:value-of select="icon:NAME/icon:FIRST-NAME"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="icon:NAME/icon:LAST-NAME"/>
		</fo:block>
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="24pt">
			<xsl:value-of select="icon:NAME/icon:JOB-TITLE"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:NAME">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start">
			<xsl:apply-templates select="icon:TITLE"/>
			<xsl:value-of select="icon:FIRST-NAME"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="icon:LAST-NAME"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:TITLE">
		<xsl:value-of select="."/>
		<xsl:text> </xsl:text>
	</xsl:template>
	<xsl:template match="icon:BODY">
		<xsl:for-each select="icon:PARA">
			<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="12pt">
				<xsl:value-of select="."/>
			</fo:block>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="icon:SALUTATION">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="12pt">
			<xsl:value-of select="."/>
			<xsl:text>,</xsl:text>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:CLOSING">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="48pt">
			<xsl:value-of select="."/>
			<xsl:text>,</xsl:text>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:RETURN-ADDRESS">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start">
			<xsl:value-of select="icon:STREET"/>
		</fo:block>
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="24pt">
			<xsl:value-of select="icon:CITY"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="icon:STATE"/>
			<xsl:text>,  </xsl:text>
			<xsl:value-of select="icon:ZIP"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:INSIDE-ADDRESS">
		<xsl:apply-templates select="icon:NAME"/>
		<fo:block font-size="12pt" line-height="15pt"
text-align="start">
			<xsl:value-of select="icon:STREET"/>
		</fo:block>
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="24pt">
			<xsl:value-of select="icon:CITY"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="icon:STATE"/>
			<xsl:text>,  </xsl:text>
			<xsl:value-of select="icon:ZIP"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:ENCLOSURE">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="24pt">
			<xsl:text>Enclosure: </xsl:text>
			<xsl:value-of select="."/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:CC-LIST">
		<xsl:for-each select="icon:NAME">
			<fo:block font-size="12pt" line-height="15pt"
text-align="start">
				<xsl:text>cc: </xsl:text>
				<xsl:value-of select="icon:FIRST-NAME"/>
				<xsl:text> </xsl:text>
				<xsl:value-of select="icon:LAST-NAME"/>
			</fo:block>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="icon:REFERENCE-INITIALS">
		<fo:block font-size="12pt" line-height="15pt"
text-align="center">
			<xsl:value-of select="."/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:DATE">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="24pt">
			<xsl:value-of select="@MONTH"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="@DAY"/>
			<xsl:text>, </xsl:text>
			<xsl:value-of select="@YEAR"/>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:SUBJECT">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start" space-after="24pt">
			<xsl:text>Subject: </xsl:text>
			<fo:wrapper font-weight="bold">
				<xsl:value-of select="."/>
			</fo:wrapper>
		</fo:block>
	</xsl:template>
	<xsl:template match="icon:ATTENTION">
		<fo:block font-size="12pt" line-height="15pt"
text-align="start">
			<xsl:text>Attention: </xsl:text>
			<xsl:value-of select="."/>
		</fo:block>
	</xsl:template>
</xsl:stylesheet>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.