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  
Posttop
Paul ZammitSubject: XSLT Editor autocomplete functionality
Author: Paul Zammit
Date: 21 Jun 2010 02:31 PM
I'm new to SS and I am simply trying to become familiar with the XSLT editor. The XML document I'm working with has multiple namespaces on the root element. When working in the editor, the auto-complete feature seems to have problems identifying elements.

Here's an example xml document:
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog xmlns="http://www.mycompany.com/abc/xml/"
xmlns:def="http://www.mycompany.com/def/xml/">
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
<def:genre>
<def:code>xyz</def:code>
<def:type>Blues</def:type>
</def:genre>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
<def:genre>
<def:code>boo</def:code>
<def:type>Country</def:type>
</def:genre>
</cd>
</catalog>

Has a default namespace and a specified namespace (def:). In the sylus studio editor, if I key in a select the root displays in the autocomplete selection window, and that's fine, but I can't see anything past root in the auto-complete window.

<xsl:apply-templates select="catalog"/> <-- catalog appears in auto assist

<xsl:apply-templates select="catalog/title"/> <-- must key in manually and does not produce a result

The generated XSLT stylesheet has no namespaces.

Once I modify the XSLT stylesheet adding namespaces, I can get it to work, but still the editor autocomplete function does not work properly.

Here is a working XSLT stylesheet:
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://www.mycompany.com/abc/xml/"
xmlns:def="http://www.mycompany.com/def/xml/">
>

<xsl:template match="/">
<catalog>
<xsl:for-each select="a:catalog/a:cd">
<cd>
<title><xsl:value-of select="a:title"/></title>
<artist><xsl:value-of select="a:artist"/></artist>
<type><xsl:value-of select="def:genre/def:type"/></type>
</cd>
</xsl:for-each>
</catalog>
</xsl:template>

</xsl:stylesheet>

Since I am new to SS, I am wondering if I'm missing something on how the XSLT editor works. I would assume that multiple namespaces are quite common, so I don't understand why the autocomplete functionality does not work the way I expected it.

Running Stylus Studio Profession Edition 2006 release 3.

Any help appreciated.

Paul

   
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.