• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Embedding XML tags in XSL

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
What I am trying to do is that I have an XML document and I want to apply a XSL stylesheet to produce another XML document.
I have right xsl utput method="xml". Still my new xml tags which I have embedded in the XSL would not show up. I am using IE 6.0. Also I am using apply-templates select=..... and so forth. I do not understand why my xml would not show up.

Thank you very much in advance for your help!
-Amish
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need some help!
Thanks
Amish
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should work. Maybe you could post your XML and XSL files (if they are not too long ) here for better diagnostics.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Amish,
Post ur code to check it properly...Definately there will be some solution.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following is the xml file AddLineItemReturn.xml

The following is my stylesheet Add_Line_Item_ii.xsl, as you will see when you apply the stylesheet to the above xml file, the TransactionReturn tags are missing, but if I insert an xml text and then TransactionReturn it works perfectly fine.


Thanks in advance for youe help!!!
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<TransactionReturn> thing works perfectly for me, so do <InsertItem> and other. The only problem in your stylesheet is how you generate Date element. XSLT has to be a well-formed XML and <xsl:text><Date </xsl:text> is surely not well-formed. There are XSL elements that you can use to add XML elements to output: <xsl:element> and <xsl:attribute> In your case it will be
<xsl:element name="Date">
<xsl:attribute name="Day">
<xsl:value-of select="Day"/>
</xsl:attribute>

</xsl:element>

And there is shorter version:
<Date Day="{Day}" Month="{Month}" Year="{Year}"/>
The whole stylesheet would be:

It works with Xalan transformer. Now all the problems with IE browser belongs to IE! Generally it's not a good idea to use a browser for XSLT transformation, because there are some compatibility issues. You can read this post for more information.
[ April 02, 2002: Message edited by: Mapraputa Is ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mapraputa You have been a great help.
This works like a charm. I was using MS IE to validate my XML and apply XSL. Also an interesting thing I found out is MS IE 6.0 also does not adhere to XML/XSL Specification. I always thought and Microsoft claims that IE 6.0 will adhere to the specs. But I guess not.
Once again thank you very much for your help!
-Amish
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic