Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
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 November 6th, 2007, 10:03 AM
Authorized User
 
Join Date: Apr 2007
Location: Chandigarh, , India.
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem in XSLT with "//" in attribute value

Hi,
Am converting HTML to XML using XSLT. The html contains custom nodes with attribute value as:
Code:
<custom attr1="/////wAFAAAAAQAAAAAAAABqAAU" />
When I perform XSLT over this, the attribute value becomes
"Extended latin set BExtended latin set B/wAFAAAAAQAAAAAAAABqAAU="

Why XALAN is converting attribute value starting with "/////"?
How can I prevent this from happening?
Thanks,
Kapil
 
Old November 6th, 2007, 10:08 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

In the absence of evidence to the contrary, I would think that Xalan is doing whatever your stylesheet asked it to do - so we need to see what your stylesheet asked it to do.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 6th, 2007, 10:25 AM
Authorized User
 
Join Date: Apr 2007
Location: Chandigarh, , India.
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default

The html is of the form:
Code:
<html>
    <div attr="/////wAFAAAAAQAAAAAAAABqAAU=">
    </div>
</html>
The XSL is:
Code:
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java">
    <xsl:output method="xml" encoding="UTF-8" />
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="div">
        <xsl:value-of select="./@attr"></xsl:value-of>
    </xsl:template>
</xsl:stylesheet>
Thanks,
Kapil

 
Old November 6th, 2007, 10:57 AM
Authorized User
 
Join Date: Apr 2007
Location: Chandigarh, , India.
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Sorry Michael. I figured out the error. It was a bug in my code.
Thanks anyway.
Regards,
Kapil





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT - Grouping by Attribute but same elements vinaura XSLT 2 July 18th, 2007 10:34 PM
XSLT, add attribute ik XSLT 6 August 22nd, 2006 11:03 AM
xslt for each and attribute tag desse XSLT 1 May 24th, 2006 08:01 AM
Problem using XSLT to change XML attribute cbeech1980 XSLT 1 October 18th, 2005 06:26 AM
changing attribute value in xslt rameshnarayan XSLT 1 August 16th, 2005 08:07 AM





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