Click here to Skip to main content
15,926,507 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: XMLNS issues with XSL transformation. Pin
Wictor Wilén18-Jun-02 1:26
Wictor Wilén18-Jun-02 1:26 
GeneralRe: XMLNS issues with XSL transformation. Pin
Domenic Denicola18-Jun-02 10:21
Domenic Denicola18-Jun-02 10:21 
GeneralEmbed JavaScript into XSL Pin
Julz31-May-02 4:20
Julz31-May-02 4:20 
GeneralRe: Embed JavaScript into XSL Pin
Erik Westermann31-May-02 8:54
professionalErik Westermann31-May-02 8:54 
GeneralRe: Embed JavaScript into XSL Pin
Julz3-Jun-02 3:21
Julz3-Jun-02 3:21 
GeneralHandling same element with different types. Pin
nay24-May-02 9:02
nay24-May-02 9:02 
GeneralRe: Handling same element with different types. Pin
Michael A. Barnhart24-May-02 10:34
Michael A. Barnhart24-May-02 10:34 
GeneralTwo questions Pin
Richard Deeming20-May-02 1:57
mveRichard Deeming20-May-02 1:57 
OK, this is probably me being stupid, but there are two things I want to do, and I can't seem to get them working:


  1. Insert special characters with the DOM
    Some Unicode characters don't get encoded properly by the DOM. I've set the encoding to UTF-8, but when I set the Text property of a node to a string containing Unicode characters, they get replaced with "?". I've tried replacing them with the relevant "Π", but that gets encoded as "Π"! Has anyone found a way to do this with the MSXML parser, or the .Net framework?
  2. Query the default namespace with XPath
    If I have an XML document with no namespace:
    <?xml version='1.0'?>
    <root>
        <someNode>Item 1</someNode>
        <someNode>Item 2</someNode>
        <someNode>Etc...</someNode>
    <root>

    I can use oNode.selectNodes("//someNode") to select the "someNode" nodes.

    If I have a namespace with a prefix:
    <?xml version='1.0'?>
    <trinet:root xmlns:trinet='http://www.trinet.co.uk/xml/Test.xsd'>
        <trinet:someNode>Item 1</trinet:someNode>
        <trinet:someNode>Item 2</trinet:someNode>
        <trinet:someNode>Etc...</trinet:someNode>
    <trinet:root>

    I can use oNode.selectNodes("//trinet:someNode").

    But, if I have a default namespace:
    <?xml version='1.0'?>
    <root xmlns='http://www.trinet.co.uk/xml/Test.xsd'>
        <someNode>Item 1</someNode>
        <someNode>Item 2</someNode>
        <someNode>Etc...</someNode>
    <root>

    oNode.selectNodes(""//someNode") returns nothing!

    So far, the only solution I have found (in .Net) is to create an XMLNamespaceManager, add the default namespace as a namespace with a prefix, and then modify the XPath query to use the prefix, passing the XMLNamespaceManager object to every call to selectNodes or selectSingleNode.

    Has anyone found a way to make the XPath query recognize the default namespace?


Thanks in advance.

Richard
GeneralRe: Two questions Pin
Erik Westermann21-May-02 17:19
professionalErik Westermann21-May-02 17:19 
GeneralRe: Two questions Pin
Richard Deeming21-May-02 22:32
mveRichard Deeming21-May-02 22:32 
GeneralCompare XML files Pin
16-May-02 19:51
suss16-May-02 19:51 
GeneralRe: Compare XML files Pin
Mike.NET17-May-02 13:45
Mike.NET17-May-02 13:45 
GeneralRe: Compare XML files Pin
Sebastian Weber6-Jun-02 6:18
Sebastian Weber6-Jun-02 6:18 
Generaldynamic display of image from XML source Pin
16-May-02 4:23
suss16-May-02 4:23 
GeneralRe: dynamic display of image from XML source Pin
Christopher Lord23-Jun-02 8:08
Christopher Lord23-Jun-02 8:08 
GeneralRe: dynamic display of image from XML source Pin
jkgh24-Jun-02 0:46
jkgh24-Jun-02 0:46 
GeneralSpace in XML Pin
Hitu14-May-02 18:33
Hitu14-May-02 18:33 
GeneralRe: Space in XML Pin
MS le Roux14-May-02 20:19
MS le Roux14-May-02 20:19 
GeneralRe: Space in XML Pin
Not Active15-May-02 6:13
mentorNot Active15-May-02 6:13 
GeneralRe: Space in XML Pin
Michael A. Barnhart15-May-02 14:06
Michael A. Barnhart15-May-02 14:06 
GeneralTypes in Schema Pin
Jamie Nordmeyer14-May-02 11:03
Jamie Nordmeyer14-May-02 11:03 
GeneralRe: Types in Schema Pin
Michael A. Barnhart14-May-02 16:53
Michael A. Barnhart14-May-02 16:53 
GeneralRe: Types in Schema Pin
Jamie Nordmeyer15-May-02 5:37
Jamie Nordmeyer15-May-02 5:37 
GeneralRe: Types in Schema Pin
Michael A. Barnhart15-May-02 13:53
Michael A. Barnhart15-May-02 13:53 
GeneralNewbie needs help with a schema. Pin
nay10-May-02 10:10
nay10-May-02 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.