Discussions

XML & Web services: XSL and Namspace declaration in the Root Element

  1. XSL and Namspace declaration in the Root Element (2 messages)

    I have an xml document with the root declared as follows:
    <searchml xmlns="http://www.flexiontech.com/xmlns/searchml">
    <document type="Word 2000 HTML">

    When I try to transform this, XSL has a problem finding the root element.If I remove the namespace declaration from the root element, XSL is able to transform without a hiccup. With the namespace declaration, I am not able to access the root either as
    <xsl:template match="/searchml">
    or as
    <xsl:template match="/">
    Does anyone know what I am doing wrong here? I have no control over how the original xml document is generated.
    TIA
    Usha
  2. I have an xml document with the root declared as follows:<searchml xmlns="http://www.flexiontech.com/xmlns/searchml">
    Do you have this URL deployed?
    <document type="Word 2000 HTML">When I try to transform this, XSL has a problem finding the root element.If I remove the namespace declaration from the root element, XSL is able to transform without a hiccup. With the namespace declaration, I am not able to access the root either as<xsl:template match="/searchml">or as<xsl:template match="/">Does anyone know what I am doing wrong here? I have no control over how the original xml document is generated.TIAUsha
  3. Yes, it is part of the Stellent XML conversion specification. I worked past this problem by adding a namespace declaration to the stylesheet declaration:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.flexiontech.com/xmlns/flexiondoc2">

    and referring to the root element thus:

    <xsl:template match="/m:searchml">
    It works fine now. Thanks for replying
    Usha