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)
- XQuery Help and Discussion (2017)
-> + Little Help :))) (2)
-> + Xquery tag position (2)
-> - Can I connect to MonetDB/XQuer... (1)
-> + Is there a way to format a num... (2)
-> + Please help convert SQL query ... (3)
-> + Connect to SQL Server Express ... (3)
-> - Convert HTML to XML within C# ... (1)
-> + return different result based ... (7)
-> + Java Heap Space (2)
-> + XQuery Results export to multi... (3)
-> + NO RETURN (5)
-> + Part of a csv into a current X... (3)
-> + How to escape ampersand in xqu... (2)
-> + How to Convert CSV lines to in... (5)
-> + Data connection Stylus Studio ... (2)
-> + Nested XQuery FLOWRs with RDBM... (3)
-> + observing xquery at work (2)
-> + alternative for 'exists' (4)
-> + Xquery and webpages how? (2)
-> + Help with another DataDirect p... (5)
-- Previous [121-140] [141-160] [161-180] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Ethan SteinSubject: Unable to Use File Name as External Variable With stylus Studio 2007 XML enterprise suite
Author: Ethan Stein
Date: 09 Jun 2009 06:59 PM
Originally Posted: 09 Jun 2009 06:58 PM
Moved to XQuery Help and Discussion Forum:
---------------------------------------------------

When I try to run the following xquery in Stylus Studio 2007 XML Enterprise Edition Build 894d, with the xPRSXMLInput external variable value of file:///C:/H0303015.xml, I get the following error:

Error encountered while initializing variable xPRSXMLInput with value file:///C:/H0303015.xml:

[DataDirect][XQuery][err:XPST0003]Error at line 1, column 6. Character ":" not allowed as start of a token.

I'm not sure what I'm doing wrong.

Please help. Thanks.

--------------------------
xQuery:

declare option ddtek:xml-streaming 'yes';
declare option ddtek:serialize "indent=yes, omit-xml-declaration=no";

declare variable $xPRSXMLInput as document-node(element(*, xs:untyped)) external;

declare function local:transformPlanName($planName as xs:string)
{
let $planName := fn:replace($planName, "AARP", "AARP®")
let $planName := fn:replace($planName, "MedicareComplete Essential", "MedicareComplete Essential®")
let $planName := fn:replace($planName, "Evercare", "Evercare®")
let $planName := fn:replace($planName, "MedicareComplete Choice", "MedicareComplete Choice®")
let $planName := fn:replace($planName, "Erickson Advantage", "Erickson Advantage®")
let $planName := fn:replace($planName, "SecureHorizons ", "SecureHorizons ®")
let $planName := fn:replace($planName, "MedicareComplete Plus", "MedicareComplete Plus™")
let $planName := fn:replace($planName, "MedicareComplete Value", "MedicareComplete Value™")
let $planName := fn:replace($planName, "MedicareComplete Premier", "MedicareComplete Premier™")
let $planName := fn:replace($planName, "MedicareComplete Balance", "MedicareComplete Balance™")
let $planName := fn:replace($planName, "MedicareComplete Mosaic", "MedicareComplete Mosaic™")
let $planName := fn:replace($planName, "MedicareDirect", "MedicareDirectࡈ")
return
if(fn:contains($planName, "MedicareComplete") and not(fn:contains($planName, "Essential")) and not(fn:contains($planName, "Choice")) and not(fn:contains($planName, "Plus")) and not(fn:contains($planName, "Value")) and not(fn:contains($planName, "Premier")) and not(fn:contains($planName, "Balance")) and not(fn:contains($planName, "Mosaic"))) then fn:replace($planName, "MedicareComplete", "MedicareComplete®")
else $planName
};

declare function local:rename($n as element(*, xs:untyped))
{
element { name($n) } {$n/@*,
if(starts-with(upper-case(local-name($n)), "PLANNAME")) then local:transformPlanName($n/text())
else
($n/text(),
for $child in $n/*
return local:rename($child))}
};

<ExtractData>
{
for $CurrentYearPlan in $xPRSXMLInput/ExtractData/CurrentYearPlan
return
local:rename($CurrentYearPlan)
}
</ExtractData>

Postnext
Ethan SteinSubject: Unable to Use File Name as External Variable With stylus Studio 2007 XML enterprise suite
Author: Ethan Stein
Date: 09 Jun 2009 07:07 PM
Okay, so I was able to get past that error if I assign the external variable to doc('C:\H0303015.xml')

However, now I get a different error when I try to run it against the DataDirect xQuery processor:

Error encountered while initializing variable xPRSXMLInput with value doc('C:\H0303015.xml'):

[DataDirect][XQuery][err:FODC0005]Exception returned by Adaptor (Streaming Adaptor) : java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\H0303015.xml


Any ideas what this means?

Postnext
Ethan SteinSubject: Unable to Use File Name as External Variable With stylus Studio 2007 XML enterprise suite
Author: Ethan Stein
Date: 09 Jun 2009 08:01 PM
Okay, issue was due to file name requiring "/" instead of "\".

Postnext
(Deleted User) Subject: Unable to Use File Name as External Variable With stylus Studio 2007 XML enterprise suite
Author: (Deleted User)
Date: 10 Jun 2009 03:35 AM
The argument for the doc() function must be a valid URI, and that implies using / as separator, and escaping non-latin characters (as well as spaces) with their HTML-escaped representation, e.g. %20

Alberto

Posttop
Ethan SteinSubject: Unable to Use File Name as External Variable With stylus Studio 2007 XML enterprise suite
Author: Ethan Stein
Date: 10 Jun 2009 04:20 AM
Good to know. Thanks.

   
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.