Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 17th, 2007, 05:04 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default namespace problem

My xml structure is like that

<?xml version="1.0" encoding="UTF-8" ?>
- <Module version="90020900" xmlns="http://xmlns.oracle.com/Forms">

for that namespace URI my xpath is not working mens in xslt i'm giving one xpression to get some node value ....but in xml if
xmlns="http://xmlns.oracle.com/Forms" is there it is not working..if i delete that xslt woking fine....how to handle this case in xslt...pls give me the syntax..i'm new to it
thnx
Reply With Quote
  #2 (permalink)  
Old February 17th, 2007, 01:32 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please google for "XSLT FAQ default namespace".

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old February 18th, 2007, 02:17 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm very new to it..if any default namespace is specified my xpath is not working..pls help me with the syntax how i have to handle it..i have searched in the net but did't understand how to avoid this...
Reply With Quote
  #4 (permalink)  
Old February 18th, 2007, 05:19 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

To select the Module element in your source document you need

<xsl:stylesheet xmlns:m="http://xmlns.oracle.com/Forms">

...

   <xsl:template match="m:Module">
     ...

and similarly for any other element in this namespace. An unprefixed name in a match pattern or XPath expression always refers to an element that is in no namespace; to refer to an element in a namespace, whether or not it is the default namespace, you need an explicit prefix.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #5 (permalink)  
Old February 19th, 2007, 12:16 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://xmlns.oracle.com/Forms">

<xsl:template match="m:Module">
<div id="treeNode{position()}" style=""><table border="0" cellspacing="0" cellpadding="0"><tr><td valign="middle" onclick="whenNodeSelected(this)">
<xsl:value-of select="m:FormModule/m:@Name"/></td></tr></table>

suppose this is my xsl....then how to do that..is the sytax is correct???
Reply With Quote
  #6 (permalink)  
Old February 19th, 2007, 12:51 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thnx.....got it..

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Namespace problem Harshal123 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 1 October 21st, 2008 06:35 AM
namespace problem muki XSLT 1 November 13th, 2005 12:25 PM
Namespace Problem JRMotz BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 12th, 2005 03:18 PM
namespace problem marclena XSLT 1 February 12th, 2004 03:48 PM
Problem with Namespace allenracho BOOK: ASP.NET Website Programming Problem-Design-Solution 2 October 22nd, 2003 11:31 AM



All times are GMT -4. The time now is 08:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.