Subject: Re: [xsl] Looping within XSL From: Kamal Bhatt <kbhatt@xxxxxxxxx> Date: Fri, 17 Mar 2006 10:18:49 +1100 |
Hello,
I am trying to generate xml file which will looks like this
<RPSL_BATCH> <RPSL_PTNR /> ... <RPSL_PTNR /> </RPSL_BATCH>
where RPSL_PTNR is as follows
<RPSL_PTNR ptnr_id="PTNR1" ptnr_type="SHIP_TO_PARTNER" sub_org="100" name_1="NAME" address_1="ADD1" address_2="ADD2" address_3="ADD3" address_4="ADD4" address_5="ADD5" city="CITY" state_name="STATE" state_code="STATE_CODE" postal_code="POSTAL" ctry_name="CTRY" ctry_code="CTRY_CODE" decision=Y rpl_ind=C epci_ind=Y antiboycott_ind=Y usembargo_ind=Y unembargo_ind=Y euembargo_ind=Y proscribed_ind=Y user_varchar1="TRANSACTION_ID" user_varchar2="GEOGRAPHICAL_LOCATION" user_varchar3="TIME_SUBMITTED"/>
Basically I need to have one RPSL_PTNR for say ship to custoemr and one for
bill to and ione for end user custoemrs etc. I will have those many
RPSL_PTNR repeating in the main batch.
I have come up with the xsl file which looks like
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- --> <!-- Template Output is XML --> <!-- --> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <xsl:element name="RPSL_BATCH"> <xsl:apply-templates select="/ORDER"/> <xsl:apply-templates select="/ORDER/PARTNER"/> <xsl:for-each select="/ORDER/PARTNER/PARTNER_ROW"> <xsl:element name="RPSL_PTNR"> <!--- BEGIN PARTNER --> <xsl:attribute name="ptnr_id="> <xsl:value-of select="/ORDER/PARTNER/CUSTOMER_NUMBER"/> </xsl:attribute> <xsl:attribute name="ptnr_type="> <xsl:value-of select="/ORDER/PARTNER/SITE_USE_CODE"/> </xsl:attribute> <xsl:attribute name="sub_org="> <xsl:value-of select="/ORDER/PARTNER/SUB_ORG"/> </xsl:attribute> <xsl:attribute name="app_id="> <xsl:value-of select="/ORDER/PARTNER/APP_ID"/> </xsl:attribute> <xsl:attribute name="name_1="> <xsl:value-of select="/ORDER/PARTNER/CUSTOMER_NAME"/> </xsl:attribute> <xsl:attribute name="address_1="> <xsl:value-of select="/ORDER/PARTNER/ADDRESS_1"/> </xsl:attribute> <xsl:attribute name="address_2="> <xsl:value-of select="/ORDER/PARTNER/ADDRESS_2"/> </xsl:attribute> <xsl:attribute name="address_3="> <xsl:value-of select="/ORDER/PARTNER/ADDRESS_3"/> </xsl:attribute> <xsl:attribute name="address_4="> <xsl:value-of select="/ORDER/PARTNER/ADDRESS_4"/> </xsl:attribute> <xsl:attribute name="address_5="> <xsl:value-of select="/ORDER/PARTNER/ADDRESS_5"/> </xsl:attribute> <xsl:attribute name="city="> <xsl:value-of select="/ORDER/PARTNER/CITY"/> </xsl:attribute> <xsl:attribute name="state_name="> <xsl:value-of select="/ORDER/PARTNER/STATE_NAME"/> </xsl:attribute> <xsl:attribute name="state_code="> <xsl:value-of select="/ORDER/PARTNER/STATE_CODE"/> </xsl:attribute> <xsl:attribute name="postal_code="> <xsl:value-of select="/ORDER/PARTNER/POSTAL_CODE"/> </xsl:attribute> <xsl:attribute name="ctry_name="> <xsl:value-of select="/ORDER/PARTNER/CTRY_NAME"/> </xsl:attribute> <xsl:attribute name="ctry_code="> <xsl:value-of select="/ORDER/PARTNER/CTRY_CODE"/> </xsl:attribute> <xsl:attribute name="created_by="> <xsl:value-of select="/ORDER/PARTNER/CREATED_BY"/> </xsl:attribute> <xsl:attribute name="request_url="> <xsl:value-of select="/ORDER/PARTNER/REQUEST_URL"/> </xsl:attribute> <xsl:attribute name="use_cached_result="> <xsl:value-of select="/ORDER/PARTNER/USER_CACHED_RESULT"/> </xsl:attribute> <xsl:attribute name="persist="> <xsl:value-of select="/ORDER/PARTNER/PERSIST"/> </xsl:attribute> <xsl:attribute name="user_varchar1="> <xsl:value-of select="./ORDER/ORDER_NUMBER"/> </xsl:attribute> <xsl:attribute name="user_varchar2="> <xsl:value-of select="/ORDER/PARTNER/SITE_USE_ID"/> </xsl:attribute> <xsl:attribute name="user_varchar3="> <xsl:value-of select="/ORDER/PARTNER/USER"/> </xsl:attribute> </xsl:element> </xsl:for-each> </xsl:element> </xsl:template> </xsl:stylesheet>
What am I doing wrong here. I get error saying not all variables bound.
I am using oralce utl_http to create the XML file.
Thanks, Manisha
-- Kamal Bhatt
T: +61 (02) 9956 7300 F: +61 (02) 9956 7411
-- Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Looping within XSL, Manisha Gore | Thread | [xsl] Parameter passing through cal, William Scarvie |
[xsl] Looping within XSL, Manisha Gore | Date | [xsl] Parameter passing through cal, William Scarvie |
Month |