xsl-list
[Top] [All Lists]

[xsl] Not able to pass Japanese text as a parameter using addParameter method of IXSLProcessor

2008-06-17 09:50:48
Hi,

This is my first post so hopefully I have adhered to the rules
correctly:

- Basically when I perform a transform after attempting to pass a
Japanese string into the stylesheet the XML produced is invalid if I
attempt to output that string in the results document. 
- Furthermore I can't match on the Japanese string which is passed in.

Using: MSXML6

Calling code:
------------------------------------------------------------------------
--
// Source XML loaded into IXMLDOMDocument2 object - CLSID_DOMDocument60
// XSL loaded into IXMLDOMDocument2 - CLSID_FreeThreadedDOMDocument60

// JAPANESE_CHARACTERS is replaced with some Japanese Hiragana and
Katakana characters in the real code.

m_pXSLProcessor->addParameter( ::CComBSTR(L"parameterName"),
::CComVariant( L"JAPANESE_CHARACTERS" ) );
.....
------------------------------------------------------------------------
---

Source XML Document:

-------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<root>
  <List>
    <ListItem id="1">no match</ListItem >
    <ListItem id="2">JAPANESE_CHARACTERS</ListItem >
  </List>
</root>
-------------------------------------

My XSL stylesheet is as follows:

---------------------------------------
<?xml version="1.0" encoding="utf-8"?>
....
<xsl:param name="parameterName"/>
....
  <xsl:variable name="matchedID"
select="/root/List/ListItem[.=$parameterName]/@id"/> 
  <Parameter><xsl:value-of select="$parameterName"/></Parameter>
---------------------------------------

Now I've changed the XML and stylesheet from what I'm actually using so
forgive any syntax errors. 

So basically:
1) 'machedID' does not find a match
2) The results document is invalid XML. The XML finishes when the first
Hiragana or Katakana, character in the Japanese string is encountered

If I change the stylesheet so that the default value of 'parameterName'
corresponds to the Japanese string passed in and then run this via
Visual Studio then everything works fine.

I could be getting this wrong on so many levels so any help would be
appreciated.

Cheers,

Peter.




------------------------------------------------------------------------
Software Imaging: The Leader in Print Imaging Technology
Printer Driver Technologies, Embedded Systems & Specialty Applications

Software Imaging Limited is a limited company registered in England and Wales
Registered Office: 9400 Garsington Road, Oxford Business Park, Oxford, OX4 2HN
Registered No: 01755090


This message is strictly private and contains confidential information intended 
only for the use of the person named above. If you have received this e-mail in 
error and are not the intended recipient you must not disclose, copy or 
distribute it to anyone else. Please immediately advise the sender and delete 
this email and all attachments.
------------------------------------------------------------------------




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>