[ https://issues.apache.org/jira/browse/XALANJ-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776099#action_12776099 ]
Daniel B. edited comment on XALANJ-1969 at 11/12/09 10:27 PM: -------------------------------------------------------------- That condition check shouldn't be too hard to implement--it can even be expressed in XPath: ancestor::* [ @xml:space = 'preserve' or @xml:space = 'default' ] [ 1 ] /@xml:space = 'preserve'' (with the current node set to the text node under consideration for stripping). was (Author: daniel7): That condition check shouldn't be too hard to implement--it can even be expressed in XPath: ancestor::* [ @xml:space = 'preserve' or @xml:space = 'default' ] [ 1 ] /@xml:space = 'preserve'' (with the current node set to the text node under considering for stripping). > xml:space not considered when deciding which elements to strip > -------------------------------------------------------------- > > Key: XALANJ-1969 > URL: https://issues.apache.org/jira/browse/XALANJ-1969 > Project: XalanJ2 > Issue Type: Bug > Security Level: No security risk; visible to anyone(Ordinary problems in > Xalan projects. Anybody can view the issue.) > Components: Xalan-interpretive, XPath-function > Affects Versions: 2.6 > Reporter: elharo > Attachments: 91444.xml, 91444.xsl, node-lister.xsl > > > This report is based on OASIS Microsoft test case Whitespaces__91444. In > breif the expected output is 22, but the actual output is 7. I'm not sure 22 > is correct, but I'm pretty sure 7 isn't. The stylesheet is as follows: > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="http://my.com"> > <xsl:output omit-xml-declaration="yes" encoding="UTF-8" indent="no"/> > <xsl:strip-space elements="*"/> > <xsl:template match="/"> > <!-- Preceding query (selection) --> > <preceding-count><xsl:value-of > select="count(html/my:element/preceding::text())"/></preceding-count> > </xsl:template> > </xsl:stylesheet> > If all white space nodes are stripped from the input document, then the > expected output would be what Xalan gives: > $ java > -Xbootclasspath/p:/opt/xalan-j_2_6_0/bin/xalan.jar:/opt/xalan-j_2_6_0/bin/xercesImpl.jar:/opt/xalan-j_2_6_0/bin/xalansamples.jar > org.apache.xalan.xslt.Process -IN 91444.xml -XSL 91444.xsl > <preceding-count > xmlns:my="http://my.com">7</preceding-count>~/Projects/XOM/datas$ > sis-xslt-testsuite/TESTS/MSFT_Conformance_Tests/Whitespaces > However, the input document contains a number of white space only nodes for > which xml:space="true", and according to section 3.4 of thre XSLT spec, these > node should be preserved regardless. > FYI, libxslt shares this bug; i.e. it also gives 7 as the output. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org For additional commands, e-mail: xalan-dev-h...@xml.apache.org