Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2009, 03:17 PM
Authorized User
 
Join Date: Jan 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dved Send a message via Yahoo to dved
Default New line 
 does not work with lxml parser

I m using lxml parser to insert my XSL to the generated XML.

Its works well except for the fact that i defined NL as 
 and it does not give me new line when I try it with lxml parser..

it works great when i m using my oxygen editor with saxon...

Is there different interpretations ??
__________________
Thanks
Dved
 
Old February 19th, 2009, 07:05 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

lxml as I understand it is a Python front-end to libxslt. Libxslt is usually pretty conformant.

I think you need to post a small but complete code example, and show the results you get with both processors.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 20th, 2009, 04:15 PM
Authorized User
 
Join Date: Jan 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dved Send a message via Yahoo to dved
Default Here is what I m doing

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [

<!ENTITY NL "<xsl:text>&#xa;</xsl:text>">

]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:strip-space elements="*"/>
<xsl:template name="header">
<xsl:text>MTN| </xsl:text>
&NL;
</xsl:template>
<xsl:template match="lertDVSResults">
<xsl:call-template name="header"></xsl:call-template>
<xsl:apply-templates select="Data/searchItem/DVSResult"></xsl:apply-templates>

</xsl:template>
<xsl:template match="serviceResponse//child::feature">
<xsl:call-template name="getFeature"></xsl:call-template>

</xsl:template>
<xsl:template name="getFeature">
<xsl:value-of select="ancestor::searchItem/child::value" />
<xsl:value-of select="'|'"/>
&NL;

</xsl:template>
</xsl:stylesheet>

The output of this XSL in Saxon6.5.5 is:
MTN|
123-123-1231|
234-234-2341|
..
.....

But what I get when I use lxml is:
MTN|123-123-1231|234-234-2341|....



Here is a bit of python part:
runner_service = self.DefinedServices[param_type][self.call_type]
xslt_doc = ET.parse(runner_service[1])
transform = ET.XSLT(xslt_doc)
call_list = runner_service[0]
### Placeholder for complete aggreagated XML results
complete_dvs_results = ET.XML("<lertDVSResults><CallType>%s</CallType><Data></Data></lertDVSResults>" % self.call_type)
return self.saveFile(str(transform(complete_dvs_results)) )


I can not write the whole python but its just simple..dont do much there except applying transform to the file..

thanks
D
__________________
Thanks
Dved
 
Old February 20th, 2009, 05:26 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

That certainly looks wrong to me. Raise a bug report with the product supplier.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
<xsl:for-each select="tokenize($indoc,'&#xA;')"> kapy_kal XSLT 4 June 9th, 2006 07:33 AM
Help needed: the PHP parser don't work! pbuongiovanni PHP How-To 8 January 12th, 2006 07:32 AM
ASP.Net Code Behind & In-Line Coding vinod_pawar1 General .NET 4 October 8th, 2004 02:33 AM
&check; not output correctly from DOM parser srivalli9 XML 4 November 19th, 2003 09:16 AM
How to configure XA-DataSource for Oracle in JBoss keseln J2EE 0 September 24th, 2003 09:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.