XSLT problem -- namespace issue?

Here's a sample XML file (created by saving a dataset):

    <?xml version "1.0" standalone="yes"?>
    <dsData xmlns="http://tempuri.org/DataSchema.xsd">
        <Configuration>
        </Configuration>
        <Data>
            <ID>0</ID>
            <Title>Test #1</Title>
        </Data>
        <Data>
            <ID>1</ID>
            <Title>Test #2</Title>
        </Data>
    </dsData>

And my XSLT style sheet:

    <xsl:stylesheet xmls:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:my="http://my.com">
        <my:Parameter>
            <name value="value1" />
            <name value="value2" />
        </my:Parameter>

        <xsl:output method="html" />
        <xsl:template match="*">
            <html>
                <body>
                    <table>
                        Sample Table
                        <xsl:for-each select="Data" >
                            <tr>
                                <td>Title:</td>
                                <td><xsl:value-of select="Title" /></td>
                            </tr>
                        </xsl:for-each>
                    </table>
                </body>
            </html>
        </xsl:template>
    </xsl:stylesheet>

My problem is when the attribute xmlns="http://tempuri.org/DataSchema.xsd"
is in the XML file, the data is not included in the output when I do the
transformation.  If, I remove the attribute, everything works fine.
Therefore, I'm suspecting I might need to specify the namespace somewhere,
somehow.

But, I've been unable to find any such examples of how to do that.  I'm
using the book "XSLT 2nd Edition" by Michael Kay.  I also searched the web a
little to no avail.

Can someone help me out here?

TIA,

Richard Rosenheim


0
2/3/2005 7:59:53 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
396 Views

Similar Articles

[PageSpeed] 47

I tried changing your XSL file to this:

   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:my="http://my.com"
xmlns:in="http://tempuri.org/DataSchema.xsd">
        <my:Parameter>
            <name value="value1" />
            <name value="value2" />
        </my:Parameter>


        <xsl:output method="html" />
        <xsl:template match="/in:dsData">
            <html>
                <body>
                    <table>
                        Sample Table
                        <xsl:for-each select="in:Data" >
                            <tr>
                                <td>Title:</td>
                                <td><xsl:value-of select="in:Title"
/></td>
                            </tr>
                        </xsl:for-each>
                    </table>
                </body>
            </html>
        </xsl:template>
    </xsl:stylesheet>

and now I get data.

Also, in future please paste the actual XML and XSL test documents into
your post. The post had some typos that made it malformed... they
couldn't be the actual documents you were testing with. It's easier and
quicker to solve your problem if we don't have to fix syntax errors
first.... :)

0
brucewood (18)
2/4/2005 12:14:14 AM
Thank you -- it's very much appreciated.

I'm gathering from your changes that basically I can have as many
xmlns:<anything> as I basically need.

I did a Google search on xmlns, and checked a number of what appeared to be
promising web sites (like http://www.w3.org/TR/xptr-xmlns/,
http://www.faqts.com/knowledge_base/view.phtml/aid/24224 and
http://www.jclark.com/xml/xmlns.htm).  Didn't find anything that was
helpful.  Nor does my 939 page XLST book even have an entry in the index for
xmlns...

Do you happen to know of a book you care to recommend?

Richard Rosenheim


"Bruce Wood" <brucewood@canada.com> wrote in message
news:1107476054.774564.194800@l41g2000cwc.googlegroups.com...
> I tried changing your XSL file to this:
>
>    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0" xmlns:my="http://my.com"
> xmlns:in="http://tempuri.org/DataSchema.xsd">
>         <my:Parameter>
>             <name value="value1" />
>             <name value="value2" />
>         </my:Parameter>
>
>
>         <xsl:output method="html" />
>         <xsl:template match="/in:dsData">
>             <html>
>                 <body>
>                     <table>
>                         Sample Table
>                         <xsl:for-each select="in:Data" >
>                             <tr>
>                                 <td>Title:</td>
>                                 <td><xsl:value-of select="in:Title"
> /></td>
>                             </tr>
>                         </xsl:for-each>
>                     </table>
>                 </body>
>             </html>
>         </xsl:template>
>     </xsl:stylesheet>
>
> and now I get data.


0
2/4/2005 12:49:29 AM
I usually get most of my information off the Web.

You want to search for "XML" and "namespaces". This is what I came up
with:

1. The W3C document is a bit opaque, but they do define the thing, so:

http://www.w3.org/TR/REC-xml-names/

2. Google found me a few more accessible write-ups:

http://www.xml.com/pub/a/1999/01/namespaces.html

http://www.w3schools.com/xml/xml_namespaces.asp

http://www-106.ibm.com/developerworks/library/x-nmspace.html

http://www.rpbourret.com/xml/NamespacesFAQ.htm

0
brucewood (18)
2/4/2005 1:47:36 AM
Thanks again.  I'll take at look at the links.

Richard Rosenheim


"Bruce Wood" <brucewood@canada.com> wrote in message
news:1107481656.012884.151970@g14g2000cwa.googlegroups.com...
> I usually get most of my information off the Web.
>
> You want to search for "XML" and "namespaces". This is what I came up
> with:
>
> 1. The W3C document is a bit opaque, but they do define the thing, so:
>
> http://www.w3.org/TR/REC-xml-names/
>
> 2. Google found me a few more accessible write-ups:
>
> http://www.xml.com/pub/a/1999/01/namespaces.html
>
> http://www.w3schools.com/xml/xml_namespaces.asp
>
> http://www-106.ibm.com/developerworks/library/x-nmspace.html
>
> http://www.rpbourret.com/xml/NamespacesFAQ.htm
>


0
2/4/2005 2:25:09 AM
Reply:

Similar Artilces:

problem with index formula
The following fomula is contained in cell C16 and returns the correct values: =VLOOKUP(B6,'Active Clients'!$B$2:$K$954,10,FALSE) The following formula is contained in cell L18 and uses the result in C16 as a lookup value in the first "match": =INDEX(L21:M44,MATCH(C16,L21:L44,1),MATCH(M16,L21:M21,-1)) My promlem is that when I try to match on cell C16 my index formula returns an error. However, when I change the index formula to reference another cell (let's say cell D16) and I type in the value shown in cell C16, the index formula works fine. I think my problem has ...

MS Outlook Installation Problem
I have installed MS Outlook from my Office 2003 CD. When i open the program up, I cannot get to the Calender. I go to the VIEW menu and I still cannot get to the Calender. i want to use Outlook vive Outlook Express on my home computer. Any suggestions of what i may be doing wrong that wil allow me to see the calender?? Outlook 2003 and Outlook Express are two different programs. Only = Outlook 2003 has a calendar feature. What are the exact symptoms that = you see when you click on the Calendar button in Outlook 2003?=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Prog...

Adobe problem
Have just installed Adobe full version 7 onto terminal server when I use Great plains and open up a document and print to screen then choose the emailto(pdf) link it comes comes up with an error telling me that if I am sending postscript fonts then to go intot the settings of adobe printer and ensure the tick box "Do not send fonts to Adobe PDF" is ticked I have ensured that the boxes are ticked but the system will not let me email this way If I choose the adobe printer and print to printer I get the option to save the pdf documnet and then the PDF will appear on the screen and I ...

Event date problem with Entourage calendar
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: pop When trying to add an event in the calendar, the date defaults to January 5, 2010, and won't let you change it to the current date, or the date of the day that the event is being created on. Any suggestions? Same thing happened to me when I first used Entourage calendar. I fixed it by checking the date/time set up under Apple preferences. Sure enough, the date was set wrong. Hope this helps. ...

Urgent Help Required on Excel Macro Problem
Hi there, We are facing one problem from around 2 months.Some of our users have XF_SIC.A virus found in their pc.XF_SIC.A virus generally found in excel workbook as macro virus.This virus create one excel 4.0 macro sheet with "very hidden and very protected" attributes in excel 97 workbooks which can't be removed as it is not seen.every time when infected excel 97 file opens it infect the default startup excel file(Book1 placed in XLSTART folder) and then every excel file that will be open will have infection as default file book1 infected.now our antivirus software mcafe...

Unicode Problems In Resource Files
Hi, I have the following unicode russian string in an excel document ????????? ???? ???????T when i paste it into the string table in the resource editor it comes out as follows Нас�,�?ойка иг�?�< �"а�?�"илд�"� why is this could someone help i am toatally at a deadend with this. Regards Adrian, >I have the following unicode russian string in an excel document >????????? ???? ???????T >when i paste it into the string table in the resource editor it comes out as >follows >�?а�?�,�?ойка иг�?�< �"а�?�"илд�"� Adrian, I believe the c...

spin control problem #2
How do I get the integer value of a spin control's associated edit control while in the edit control's OnEnChange function. Everytime I try to extract the data I get an exception error. If you have a problem in spin control, hire a good publicist... (sorry, I couldn't resist) First, show the code. Then say PRECISELY what you mean by "exception error", showing the exact line of code that experiences the problem. Otherwise, there is no way to tell what you've done! joe On Thu, 26 Jul 2007 07:43:21 -0700, "Z.K." <nospam@nospam.net> wrote: ...

Include top nav abr problem
Hi all, I have a website with an "Include_top" with a nav bar. This renders OK on all but 1 page on main site and subsite. http://www.gundogs-wales.co.uk/Gundogtest/Lakeside_Link.htm and http://www.gundogs-wales.co.uk/Lakeside_Link.htm I have tried removing and reinstalling the "Include_top" page to no effect. can anyone help please TIA Teriel9 Looks like you are missing the style sheet link in the head section in both pages at http://www.gundogs-wales.co.uk/Lakeside_Link.htm add <link rel="stylesheet" href="style.css" type="te...

Problem about Sample Database
Dear all, I have a MS CRM license with MSDN. I completly installed MS CRM with organization named "Adventure Works Cycle. I got 6 licenses of Suite Professtional. But when I tried to install sample database following http://www.microsoft.com/technet/prodtechnol/mscrm/mscrm1/m aintain/20_samdb.mspx . It was error in step of add license. I added 8JUNYZUK3U66WXTRP7WE1 and the error screen was shown "You must enter a valid license key". Please help me solve this problem. Thanks !!! dinorex "dinorex" <anonymous@discussions.microsoft.com> wrote in messag...

XSLT for an xml with namespace
HI can anyone help me out with this, im a newbie to xml n stuff. i really have tough time working on this . Xml file: <p:win32_Service xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://schemas.microsoft.com/wsman/2005/06/wmi/root/cimv2/win32_Service"> <p:AcceptPause>true</p:AcceptPause> <p:AcceptStop>true</p:AcceptStop> <p:Caption>Windows Management Instrumentation</p:Caption> <p:StartMode>Auto</p:StartMode> <p:StartName>LocalSystem</p:StartName> <p:State>Running</p:State> &...

problem retaining cursor on same position in subform
Hi, I have a main form with a Combobox and a subform that use to display relate record when the combobox is selected. In the subform, I have a button to open another form (frmEditCommune) for editing specific record. When finish editing and closing the frmEditCommune form, I want the subform to requery and retain the cursor on the current record. The code below did requery/refresh the content but move the cursor to the first row of the subform. Could anyone advice how to maintain the cursor to the previuos position in the subform? Dim rst As DAO.Recordset Dim strCriteria As S...

Problem with reading Reminders in Outlook 2003
Every time I start Outlook 2003 a pop-up message appears: "There was a problem reading one or more of your reminders. Some reminders may not appear. Cannot locate recurrence information for this appointment." How do I get rid of this annoying pop- up message? I have tried to take all my reminders that I could find out of my calendar, the message still appears. What do I need to do? Has anyone experience similar problem. How do I get rid off this pop-up message. Many thanks for your help. Martin. Martin <martin@kellyville.org.au> wrote: > Every time I start Outlook 2003 a...

Timer issue
Hi, I have a Dialog and do some graphic intensive operations in OnPaint. I also have a Timer and also have a custom background. I also set a custom cursor in OnInitDialog. Moreover, for every WM_TIMER, I will see for a data and will also repaint. So for every WM_TIMER, I have a WM_PAINT and WM_ERASEBKGRND happening. The problem is, because of this my new cusror flashes, that is disappears for a moment and again reappears. When I remove my timer, I don't see my cursor flashing. What could be wrong ? Do WM_TIMER, WM_PAINT,WM_ERASEBKGRND have anything to do with Cursor ? Thanks a lot, sath_...

Email display problem
I've lost the "to" and "from" lines from the emails I've received - how do I put them back? thanks! -- Michael Abraham Toronto, Canada Put them back where, exactly? Where are they missing from? -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will probably not be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:%23whdIyAmDHA.424@TK2MSFTNGP10.phx.gbl, Michael Abraham wrote: > I've lost the "to" and "from" lines from the emails I've received - > how do I put...

Little help, 5.5 to 2k3 migration problems (long)
Hi, First post here, so I apologise in advance if I get anything too wrong, or it's too long. I had Exch 5.5 running on a Win2k domain controller, 60 odd users, some public folders, some delegate access etc. I decided to migrate the system to a Win2003 / Exchange 2k3 server, following the deployment instaurations on the CD. *Note: on further investigation on the KB, it seems that I should have run the 5.5 DS/IS constancy checker before the migration to iron out any ACL/AD issues - this wasn't done. I have also discovered that my original ex5.5 site name contained invalid character...

Problem with Query
I have a workbook that has been created which holds two worksheets. The first worksheet allows for a tick mark to be placed in a column, which will fill into the second worksheet upon a refresh of data. The problem is the process works fine on one users PC, all new data is filled in upon a refresh. However, when other users access the file and refresh data, there are 3 columns of data that do not refresh. ...

Encryption problem with Money 2004 Business
I recedntly purchased a new lap top and tried to load Microsoft Money 2004 Small Bussiness and the program refused to run. An error message appears that states that The system cannot encryt date at the desired level. All Internet Explorere and Microsoft Windows XP upgrades are in place. Any suggestions? -- Razorback Jack In microsoft.public.money, Razorback Jack wrote: >I recedntly purchased a new lap top and tried to load Microsoft Money 2004 >Small Bussiness and the program refused to run. An error message appears >that states that The system cannot encryt date at the de...

money upgrade problem with online services.
I just upgraded to Money 2005 Deluxe trial version and I can't get my accounts to work online. I go to manage online services and i click set up online services, choose the account type, select the bank, then it gives me the add a new account screen (which actually adds another account, instead of adding services to my existing account). If i try to follow through with actually putting the info in...it just hangs forever and then it fails. ...

Strange problem with EX2003
I have an Exchange 2003 server which has 11 mailboxes configured and working with no problems. I've just added a new user and can logon fine via Outlook 2003 and I am able to send and receive email to external users with this user. However if I look in our internal address book the user is not listed. Also if I grant permission for other users to read this mailbox, the other users are unable to read any of the mail in the inbox. I've tried restarting the Exchange services and the rebuild in RUS but the problem still persists. Could this be a licensing problem as I only have 5 user lice...

Problems with OutLook closing after latest Security patches
After applying MS04-011 to 014 to our Win2KProw/SP4 and Off2Kw/SP3 computers, when users exit OL, the exit splashscreen just stays, never going away. Any ideas on what to do to fix this? Thanks! ...

ISBN problem
Hi guys I'm having a problem with my product catalogue with my online store. download the catalogue to .csv file and open it in excel. When I ope the file it removes the zero from the ISBN number. (eg 07654321 become 7654321). This is becoming a big pain. Is there anyway I can prevent excel from automatically doing thi -- digital21s ----------------------------------------------------------------------- digital21st's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2957 View this thread: http://www.excelforum.com/showthread.php?threadid=49274 Hi Try renam...

Multiple Problems--Possible Corruption of Local Live Program
Starting about 2 days ago, my onsite program to access Windows Live Hotmail (which I've used successfully for 9 months) has acted unstably. Here are the symptoms: (1) About half the time I start the program, my address book is missing--i.e. "contacts" show zero. The other half of the time, it does appear. (2) In responding to some emails, the enter key doesn't function. (3) I can't send a message in which I copy-and-pasted some Excel lines. The send function just hangs up. (4) When I do have a malfunction, I am sometimes unable to end the "wlmail" ...

EPSON POS Receipt Printer TM T88III problem
Hi guys, first post here and hope some of you can help or have experience I just bought a new TM88III thermal receipt printer (serial) and a serial cable from the POS-WAREHOUSE ; i am using RETAIL PLUS 2.0 download/trial version to test out the POS. I have a PC running Win XP. When I was testing the POS, I have no problems of the POS software after a transaction is done, we hit ENTER and it will print out an invoice from our inkjet printer. This mean the POS program is stable. I have gone to download the driver software A301.gk (or something like that) from official EPSON support website a...

How to change the Volume 1, Issue 1 template
How do i change and work with volume, and issue template in Publisher? everytime i click on it it wont let me change the numbers. does this work by itself? how do i work with this feature? is there a tutorial that discusses this item? You double-click on it and then you can change anything you want. -- JoAnn Paules MVP Microsoft [Publisher] "hotmail problems" <hotmailproblems@discussions.microsoft.com> wrote in message news:19CDFE4F-E793-417D-AF54-E0EE99382CEC@microsoft.com... > How do i change and work with volume, and issue template in Publisher? > everytim...

"Name" problem with Outlook Connector
Hi, I have Outlook 2003 and have used it for years with my Hotmail account. Like many, I had to download the Outlook Connector tool recently to maintain the integration and it's worked fine with one exception. When I look at "Sent Items", everything is listed under my username. If I click on the message, I can then see the actual person it was sent to (and there were no delivery problems). But looking at my messages in the "Sent To" view, everything I've sent using Outlook since downloading Outlook Connector lists it as my username. If I log onto Hotmail...