Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down Default namespace and XSLT

    Hi,

    I got a default namespace as xmlns="path/to/default/namespace/" in my xml file, and following is what I am using for xsl file:
    Code:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:h="path/to/default/namespace/"
      exclude-result-prefixes="h"
      xmlns="http://www.w3.org/1999/xhtml">
    It is not working, just breaks the page. when I remove the attribute xmlns from xml file then it works fine, but with default namespace it doesn't.

    Is there anyone tell me how can i get it working with default namespace?

    Thanks.
    Last edited by apnausman; 06-07-2011 at 11:19 PM.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,237
    Thanks
    12
    Thanked 340 Times in 336 Posts
    either you access the XML elements with the h: prefix in your XSL or you change the XSL’s default namespace.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried using with h: but didn't work, what should I change to for default namespace?

  • #4
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I also have this problem now, where the Xpath/XSLT navigation doesn't work if there is a default namespace in the XML file.

    Any solutions to this?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •