XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Brandon dimperioSubject: XSLT a:?
Author: Brandon dimperio
Date: 09 Mar 2008 08:01 PM
Originally Posted: 09 Mar 2008 07:58 PM
so far for whatever reason I HAVE to use a: to access any elements of my document, I'm taking an XML class and we had 2 hours of information on XPath and 2 hours on XSLT and until I got ahold of stylus I couldn't manage to access anything other than copy of /

I haven't been able to find what this means anywhere on the internet, my assumption is it means ancestor?

I'm writing my code in the <xsl:template match="/"> section. should it be somewhere else so I don't have to use a:?

This is my XML doc up to the end of the DTD

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="transformers.xslt"?>
<!DOCTYPE orders2 [
<!ELEMENT orders2 (storeInfo,order+)>
<!ATTLIST orders2 xmlns CDATA #REQUIRED>
<!ELEMENT storeInfo (storename,location)>
<!ELEMENT storename (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT order (date,discount?,orderItem+)>
<!ELEMENT date (#PCDATA) >
<!ELEMENT discount (#PCDATA)>
<!ELEMENT orderItem (costper,quantity,product)>
<!ELEMENT costper (#PCDATA)>
<!ELEMENT quantity (#PCDATA)>
<!ELEMENT product (#PCDATA)>

in the xslt I have to do the following to procduce data:

<xsl:for-each select="a:orders2/a:order">

or <xsl:value-of select="a:date"/>

James DurningSubject: XSLT a:?
Author: James Durning
Date: 10 Mar 2008 11:16 AM
Originally Posted: 10 Mar 2008 11:15 AM
This is a namespace prefix. If your xml document has xmlns="somewebsite.com", you have to specfically use that url in your xsl as well. eg. xmlns:a="somewebsite.com" then find a:someelement.


Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.