[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

XQuery voice xml dtd use

Michele Cleary clearlymichele at yahoo.com
Sat Apr 11 12:59:23 PDT 2009


  XQuery voice xml dtd use
I'm trying to get the dtd into my voice xml xquery.  For some reason, it's giving me a syntax error.  Output looked great and syntax was fine before I added the declare option parts.  I ran this in oxygen <oXygen/> XML Editor 10.1, build 2009022712 using the xquery debugger.

My xquery document is genVInfo.xquery:

declare namespace local = "http://lyle.smu.edu/~mcleary/a3";
(: use name to look up group :)
declare function local:getGroup($theName as xs:string?)
as xs:string?
{
    let $group :=
    for $user in doc("domain.xml")//user
    where $user/name = $theName
    return $user//group
return $group
}; 
let $phone := "5854674893"
let $output := 
    for $dom in doc("domain.xml")/users/user,
     $user in doc("users.xml")/users/user[@phone = $phone]
     where $dom/name=$user/name
     return ("Welcome to Group Finder", data($dom/name) , ". We see that you",
     for $fan in $dom/name
     return concat(" like the group: ", local:getGroup(data($fan)) ) )

return 
declare option saxon:output '"doctype-public=-//W3C//DTD VOICEXML 2.0//EN"';
declare option saxon:output '"doctype-system=http://www.w3.org/TR/voicexml21/vxml.dtd"'; 
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
  <block>{
  
   <prompt>
   
     {$output}
 
   
   </prompt>
   }
  </block>
 </form>
</vxml>

My users.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<users>
   <user id="1a" phone="5854674893">
       <name>Mary Lamb</name> 
       <datas>
           <group>Jack Johnson</group>
       </datas>
   </user>
    <user id="2a" phone="5853232105">
        <name>Little Muffit</name> 
        <datas>
           <group>Sarah Brightman</group>
       </datas>
   </user>
    <user id="3a" phone="5857645615">
       <name>Jack Jill</name> 
       <datas>
           <group>UB40</group>
       </datas>
   </user>
</users>

My domain.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user id="1a">
       <name>Mary Lamb</name>
       <datas>
           <group>JackJohnson</group>
           <youtube>http://tinyurl.com/ajoc8r</youtube>
           <mp3>http://www.mp3raid.com/search/mp3/jack_johnson.html</mp3>
           <rssfeeds>http://www.fiercepoet.com/index.php/weblog/2005/05/</rssfeeds>
           <news>http://blogs.thenewstribune.com/ej/2008/03/03/jack_johnson_set_to_rock_the_gorge</news>
       </datas>
   </user>
   <user id="2a">
       <name>Little Muffit</name>
       <datas>
           <group>SarahBrightman</group>
           <youtube>http://tinyurl.com/cdy4cq</youtube>
           <mp3>http://www.mp3raid.com/search/mp3/sarah_brightman.html</mp3>
           <rssfeeds>http://noolmusic.com/search_videos/sarah_brightman</rssfeeds>
           <news>http://artsblog.freedomblogging.com/2008/12/17/sarah-brightman-disses-her-high-f/5144/</news>
       </datas>
   </user>
   <user id="3a">
       <name>Jack Jill</name>
       <datas>
           <group>UB40</group>
           <youtube>http://tinyurl.com/bsxknz</youtube>
           <mp3>http://www.mp3raid.com/search/mp3/ub40.html</mp3>
           <rssfeeds>https://www.freebase.com/view/en/ub40</rssfeeds>
           <news>http://www.pop-music.com/article1277.html</news>
       </datas>
   </user>
</users>

Output looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.1">
   <form>
      <block>
         <prompt>Welcome to Group Finder Mary Lamb . We see that you  like the group: JackJohnson</prompt>
      </block>
   </form>
</vxml>

My syntax error when I added the declare option is:
F [Saxon-B XQuery 9.1.0.5] XQuery syntax error in #...n declare option saxon:output#:     Unexpected token "declare option" in path expression

Any idea how to fix it?  I need my output to look like this at the top:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vxml
    PUBLIC "-//W3C//DTD VOICEXML 2.0//EN"
    "http://www.w3.org/TR/voicexml21/vxml.dtd">
<vxml version = "2.1" xmlns="http://www.w3.org/2001/vxml">




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20090411/db59dd7e/attachment.htm


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.