none
XSLT - Can you disable namespaces ?

    Question

  • Hi

    With Fred Bao help, i resolved my issue with using XSLT on XML by use of a namespace.

    Now i assume people reference these as they contain rules etc on the data type.

    In my case i don't need this.

    => Is it possible in the XSLT to say ignore namespace references in the stylesheet ?

    and only use the default xmlns:xsl="http://www.w3.org/1999/XSL/Transform"(?)

    In this way references in the XML will not need a dummy namespace.

    Thanks



    Wednesday, October 02, 2013 10:31 AM

Answers

  • Hello Greg,

    From my opinion, I think it is impossible.

    Just image the XML file to be a class named A, the XSL file to be a function in Class B, so if we want to call the function in A, we need to make sure both A and B are under the same namespace.

    I think the XSL and XML need to follow this rule, too.

    I add the namespace in XSL File because the XML file has already been in a namespace.

    >>In this way references in the XML will not need a dummy namespace

    I notice that the XML file is created by Microsoft's Visual Studio.

    So if we do not want the namespace, we need to control the program to let it create the XML file without the namespace so that we do not need to add the namespace in XSL file, too.

    Regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, October 04, 2013 6:43 AM
    Moderator