You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/10/10 01:45:58 UTC
DO NOT REPLY [Bug 4056] New: -
Transformer is unable to proces if xml:space="preserve" attribute is set in parent. Please find attached XSL
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4056>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4056
Transformer is unable to proces <xsl:attribute name="even-id"> if xml:space="preserve" attribute is set in parent. Please find attached XSL
Summary: Transformer is unable to proces <xsl:attribute
name="even-id"> if xml:space="preserve" attribute is
set in parent. Please find attached XSL
Product: XalanJ2
Version: 2.0.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: org.apache.xalan
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: manoj.mandke@tibcofinance.com
Xalan 2 Transform gives folowing error for tranformation of one form od xml
into another using specified XSL.
I get following error
file:///C:/Tools/xalan-j_2_2_D11/samples/SimpleTransform/birds.xsl; Line 16; Col
umn 35; event-id has an illegal attribute: {1}
If I remove attribute "xml:space=preserve" of <EVENT> element, thing work all
right.
XSL File
=========
<?xml version="1.0" encoding="UTF-8"?>
<!-- $RCSfile: Newsml2Event.xsl,v $ $Revision: 1.13 $ $Date: 2000/12/13
02:22:08 $ -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">
<xsl:strip-space elements="*"/>
<xsl:template match="NewsML">
<xsl:apply-templates select="NewsItem"/>
</xsl:template>
<xsl:template match="NewsItem">
<EVENT xml:space="preserve">
<xsl:attribute name="event-id"><xsl:value-of
select="Identification/NewsIdentifier/PublicIdentifier"/>:<xsl:value-of
select="Identification/NewsIdentifier/RevisionId"/></xsl:attribute>
<DIR name="content">
<STRING name="headline">
<xsl:choose>
<xsl:when test="string-length(
NewsComponent/NewsLines/HeadLine )>0">
<xsl:apply-templates
select="NewsComponent/NewsLines/HeadLine/descendant-or-self::text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates
select="NewsComponent/NewsLines/NewsLine[NewsLineType/@FormalName='alert']
[1]/NewsLineText/descendant-or-self::text()"/>
</xsl:otherwise>
</xsl:choose>
</STRING>
<STRING name="story">
<xsl:apply-templates
select="NewsComponent/ContentItem/DataContent/descendant-or-self::text()"/>
</STRING>
</DIR>
<DIR name="meta">
<xsl:apply-templates select="NewsComponent/TopicSet
[@FormalName='ReutersMetaData']/Topic/Property[@FormalName='Code']"
mode="meta"/>
<STRING name="provider"><xsl:value-of
select="Identification/NewsIdentifier/ProviderId"/></STRING>
<STRING name="any"><xsl:value-of
select="Identification/NewsIdentifier/ProviderId"/></STRING>
<xsl:variable name="attribution"
select="NewsComponent/AdministrativeMetadata/Source/Party/@FormalName"/>
<xsl:if test="$attribution">
<STRING name="attribution"><xsl:value-of
select="$attribution"/></STRING>
<STRING name="any"><xsl:value-of
select="$attribution"/></STRING>
</xsl:if>
<xsl:variable name="language"
select="NewsComponent/DescriptiveMetadata/Language[1]/@FormalName"/>
<xsl:if test="$language">
<STRING name="language"><xsl:value-of
select="$language"/></STRING>
<STRING name="any"><xsl:value-of select="$language"/></STRING>
</xsl:if>
</DIR>
<DIR name="teasers">
<STRING name="teaser0"/>
<STRING name="teaser1"/>
<STRING name="teaser2"/>
<STRING name="teaser3"/>
<STRING name="teaser4"/>
</DIR>
</EVENT>
</xsl:template>
<xsl:template match="Property" mode="meta">
<STRING name="{../TopicType/@FormalName}"><xsl:value-of
select="@Value"/></STRING>
<STRING name="any"><xsl:value-of select="@Value"/></STRING>
</xsl:template>
</xsl:stylesheet>
Input XML File
=========
<NewsML><NewsEnvelope><DateAndTime/></NewsEnvelope><NewsItem Duid="NewsItem"
xml:space="preserve"><Identification><NewsIdentifier><ProviderId>reuters.com</Pr
oviderId><DateId>20011009</DateId><NewsItemId>nWEL37400</NewsItemId><RevisionId
PreviousRevision="1"
Update="U">2</RevisionId><PublicIdentifier>urn:newsml:reuters.com:20011009:nWEL3
7400</PublicIdentifier></NewsIdentifier></Identification><NewsManagement><NewsIt
emType FormalName="News"/><FirstCreated>20011009T120921-
0700</FirstCreated><ThisRevisionCreated>20011009T120921-
0700</ThisRevisionCreated><Status
FormalName="Usable"/></NewsManagement><NewsComponent Essential="yes"><TopicSet
FormalName="ReutersMetaData"><Topic Duid="providedby"><TopicType
FormalName="providedby"/><Property FormalName="Code"
Value="NDS"/></Topic><Topic Duid="companies"><TopicType
FormalName="companies"/><Property FormalName="Code" Value=".NZ40"/><Property
FormalName="Code" Value="FBU.NZ"/><Property FormalName="Code"
Value="FFS.NZ"/><Property FormalName="Code" Value="TEL.NZ"/><Property
FormalName="Code" Value="TRH.NZ"/></Topic><Topic Duid="nameditem"><TopicType
FormalName="nameditem"/><Property FormalName="Code"
Value="NZ/ADR"/></Topic><Topic Duid="topics"><TopicType
FormalName="topics"/><Property FormalName="Code" Value="NZ"/><Property
FormalName="Code" Value="ASIA"/><Property FormalName="Code"
Value="STX"/><Property FormalName="Code" Value="US"/><Property
FormalName="Code" Value="LEN"/><Property FormalName="Code"
Value="RTRS"/></Topic><Topic Duid="products"><TopicType
FormalName="products"/><Property FormalName="Code" Value="ND"/><Property
FormalName="Code" Value="E"/><Property FormalName="Code" Value="RNP"/><Property
FormalName="Code" Value="DNP"/><Property FormalName="Code"
Value="PCO"/><Property FormalName="Code" Value="PCU"/></Topic><Topic
Duid="headline_pes"><TopicType FormalName="headline_pes"/><Property
FormalName="Code" Value="511 376 408 416 433 443 458"/></Topic><Topic
Duid="story_pes"><TopicType FormalName="story_pes"/><Property FormalName="Code"
Value="511 376 408 416 433 443 458"/></Topic></TopicSet><Role
FormalName="main"/><NewsLines><HeadLine>NZx Morning Call-NZ ADRs flat, Telecom
<Origin Href="QuoteRef">TEL.NZ</Origin>
slips</HeadLine></NewsLines><AdministrativeMetadata><Source><Party
FormalName="RTRS"/></Source></AdministrativeMetadata><DescriptiveMetadata><Langu
age FormalName="EN"/></DescriptiveMetadata><ContentItem
Duid="story1"><DataContent><pre> WELLINGTON, Oct 10 (Reuters) - Prices of
selected New Zealand
stocks listed in the United States, and the change from their
close on the previous New Zealand and U.S. trading days.
All columns are shown converted to New Zealand shares and
currency except the first column which shows the ADR priced in
U.S. dollars:
ADR -----------Converted--------
Price Price Change vs Volume
Company: USD NZD NZ close (000)
FCL Building <Origin Href="QuoteRef">FLB.N</Origin> 11.16 2.71
nil 30
FCL Forests <Origin Href="QuoteRef">FFS.N</Origin> 1.00 0.24
nil 115
Telecom <Origin Href="QuoteRef">NZT.N</Origin> 14.28 4.33 -
4 125
Tranz Rail <Origin Href="QuoteRef">TNZR.O</Origin> untraded
NOTE- The above rates were at 8:00 a.m. (NZT) when the Dow
Jones Industrial Average <Origin Href="QuoteRef">.DJI</Origin> was down 23
points at 9,045. They
are based on a conversion rate of NZ$=$0.4124.
On the New York Stock Exchange, Telecom American Depositary
Receipts are traded in bundles of eight ordinary shares, while
Fletcher Building and Forests shares are traded in bundles of 10.
On the Nasdaq exchange, Tranz Rail ADSs are traded in bundles
of three ordinary shares.
((Wellington newsroom, tel +64 +4 471-4277, fax +64 +4 473
6212, wellington.newsroom@reuters.com))
</pre></DataContent></ContentItem></NewsComponent></NewsItem></NewsML>