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

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