Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Howto add static text in xsl stylesheet

360022May 18 2005 — edited May 23 2005
Hi,

I'am having problems trying to write a static text to a fixed length file using the file adapter.

I'am using the FlatStructure sample provided.

When I run the sample, there's no problem... But when I remove the mapping from tns:State <-> fix:State (in addr1Toaddr2.xsl) and change the fix:State to a static text (Set Text option in right mouse popup menu) then this text will NOT show up in the written fixed length file.

My addr1Toaddr2.xsl looks like this:

<?xml version="1.0" encoding="windows-1252"?>
<?oracle-xsl-mapper
<!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="XSD">
<schema location="file://D:/OraBPELPM_2/integration/bpelpm/orabpel/samples/tutorials/121.FileAdapter/FlatStructure/address-csv.xsd"/>
<rootElement name="Root-Element" namespace="http://xmlns.oracle.com/pcbpel/demoSchema/csv"/>
</source>
</mapSources>
<mapTargets>
<target type="XSD">
<schema location="file://D:/OraBPELPM_2/integration/bpelpm/orabpel/samples/tutorials/121.FileAdapter/FlatStructure/address-fixedLength.xsd"/>
<rootElement name="Root-Element" namespace="http://xmlns.oracle.com/pcbpel/demoSchema/fixedLength"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 1.0 AT [WED MAY 18 11:29:24 CEST 2005]. -->
?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xmlns.oracle.com/pcbpel/demoSchema/csv" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:fix="http://xmlns.oracle.com/pcbpel/demoSchema/fixedLength" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" exclude-result-prefixes="xsl xsd tns nxsd fix ldap xp20 bpws ora orcl">
<xsl:template match="/">
<fix:Root-Element>
<xsl:for-each select="/tns:Root-Element/tns:Address">
<fix:Address>
<fix:Name>
<xsl:value-of select="tns:Name"/>
</fix:Name>
<fix:Street>
<xsl:value-of select="concat(tns:Street1,' ',tns:Street2)"/>
</fix:Street>
<fix:City>
<xsl:value-of select="string('C2345678901')"/>
</fix:City>
<fix:State>
<xsl:text disable-output-escaping="no">D2345678901
</xsl:text>
</fix:State>
<fix:Country>
<xsl:value-of select="string('E234567')"/>
</fix:Country>
</fix:Address>
</xsl:for-each>
</fix:Root-Element>
</xsl:template>
</xsl:stylesheet>

Note:
The construct "<xsl:value-of select="string('E234567')"/>" is my 'patch'to write a static text.

Can you tell me what I'am doing wrong? Or is this a bug...

greetings,
Jan.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2005
Added on May 18 2005
3 comments
773 views