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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
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"/>

Posttop
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.



http://www.thescripts.com/forum/thread768835.html

   
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!  
go

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.