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)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Arne JohnsenSubject: NO RETURN
Author: Arne Johnsen
Date: 02 Nov 2009 06:57 AM
Hi. I am new to Stylus and XQuery. Have downloaded Stylus Studio 2010 Enterprise Suite for evaluation and training because I need to query xml-files. I perform xqueries against the example-files in Stylus, and get returns. But when i query my local xml-file, I get no return. The query processes without returning any errors, and the file checks out as "well formed". And I can open it in Tree-view and grid-view.
Any tips as to why?

:-?Arjo

Postnext
Ivan PedruzziSubject: NO RETURN
Author: Ivan Pedruzzi
Date: 02 Nov 2009 05:42 PM


Can you show us the query and XML?

Ivan Pedruzzi
Stylus Studio Team

Postnext
Arne JohnsenSubject: NO RETURN
Author: Arne Johnsen
Date: 03 Nov 2009 03:06 AM
To simplify things, I have removed most of the file (it's rather big). And I have altered sensitive data in it, but all the elements etc are present.
The file looks like this:
**********
<?xml version="1.0" encoding="utf-8"?>
<Melding versjon="47.0.3" fraDatoPeriode="2009-01-01" uttakDato="2009-09-23" kontPerson="Borte Bra" meldEpost1="en@adresse.no" meldRefNr="2004-3-47" tilDatoPeriode="2009-09-30" meldTelefon="+47 67 12 34 54" meldEpost2="annen@adresse.no" xmlns="http://www.npr.no/xmlstds">
<Institusjon institusjonID="123456789">
<Enhet enhetID="123456789" enhetKode="123456789" isfRefusjon="1" reshID="2365110" enhetLokal="123456789"/>

<Enhet enhetID="133" enhetKode="2411" isfRefusjon="1" reshID="109573 " enhetLokal="2411"/>
<Enhet enhetID="135" enhetKode="3010" isfRefusjon="1" reshID="102963 " enhetLokal="3010"><Enhet enhetID="55375" enhetKode="1010" isfRefusjon="1" reshID="100176 " enhetLokal="D1010"/></Enhet>
<Enhet enhetID="55394" enhetKode="3010" isfRefusjon="1" reshID="100177 " enhetLokal="D3010"/>
<Enhet enhetID="55414" enhetKode="5800" isfRefusjon="1" reshID="100178 " enhetLokal="D5800"/>
<Pasient pasientNr="676767" kjonn="2" fodselsar="1908">
<Henvisningsperiode henvisningsperiodeID="5773922" ansienDato="2008-08-18" trygdenasjon="NO">
<Henvisning henvID="5773922" fagenhetID="55394" tjenesteenhetID="55394" behandlingsstedID="974316285" mottaksDato="2008-08-18" henvType="4" henvFormal="1" frittSykehusvalg="2" omsnivahenv="1" fagomrade="140" vurdDato="2008-08-18" fristStartBehandling="2008-08-18" rettTilHelsehjelp="3" ventetidSluttDato="2008-08-18" ventetidSluttKode="1"/>
</Henvisningsperiode>
</Pasient>
<Pasient pasientNr="675180" kjonn="2" fodselsar="1908">
<Henvisningsperiode henvisningsperiodeID="4375002" ansienDato="2009-02-02" trygdenasjon="NO" sluttDato="2009-02-03">
<Henvisning henvID="5875002" fagenhetID="55394" tjenesteenhetID="55394" behandlingsstedID="974316285" mottaksDato="2009-02-02" henvType="4" henvFormal="1" frittSykehusvalg="2" omsnivahenv="1" fagomrade="110" vurdDato="2009-02-02" fristStartBehandling="2009-02-02" rettTilHelsehjelp="3" ventetidSluttDato="2009-02-02" ventetidSluttKode="1"/>
</Henvisningsperiode>
<Episode episodeID="8672778" henvisningsperiodeID="5875002" fagenhetID="55394" tjenesteenhetID="55394" behandlingsstedID="974316285" innDatoTid="2009-02-02T16:15:00" fraSted="1" debitor="1" episodeFag="110" komNrHjem="1201" inntilstand="1" innmateHast="1" omsorgsniva="1" utTilstand="1" tilSted="3" utDatoTid="2009-02-03T14:30:00">
<AvdOpp oppholdstype="1"/>
<Tilstand tilstNr="1">
<Kode kodeNr="1" Kodeverk="D" kodeVersjon="9" kodeVerdi="I64"/>
</Tilstand>
<Tilstand tilstNr="2">
<Kode kodeNr="1" Kodeverk="D" kodeVersjon="9" kodeVerdi="F03"/>
</Tilstand>
<Tilstand tilstNr="3">
<Kode kodeNr="1" Kodeverk="D" kodeVersjon="9" kodeVerdi="I219"/>
</Tilstand>
</Episode>
</Pasient>
</Institusjon>
</Melding>
******************

I have placed the file in the example-folder of Videocenter, and I can retrive the whole file by:

doc("file:///C:/Program Files (x86)/DataDirect Integration Suite 2010/Stylus Studio Enterprise Suite/examples/VideoCenter/Mini_Melding.xml")

But the command:

doc("file:///C:/Program Files (x86)/DataDirect Integration Suite 2010/Stylus Studio Enterprise Suite/examples/VideoCenter/Mini_Melding.xml")/Melding/Institusjon/Enhet

returns nothing.
And I have made a scenario where I have mapped the file as main input, and tried the command : .//Pasient, - but still nothing, just an empty preview.
Am I missing something?

Postnext
(Deleted User) Subject: NO RETURN
Author: (Deleted User)
Date: 03 Nov 2009 10:03 AM
Hi,
your XML is using a default namespace (see the xmlns="http://www.npr.no/xmlstds" declaration in the top level element), so you should write a query like this:

declare namespace p = "http://www.npr.no/xmlstds";

doc("file:///C:/Program Files (x86)/DataDirect Integration Suite 2010/Stylus Studio Enterprise Suite/examples/VideoCenter/Mini_Melding.xml")/p:Melding/p:Institusjon/p:Enhet

Hope this helps,
Alberto

Posttop
Arne JohnsenSubject: NO RETURN
Author: Arne Johnsen
Date: 04 Nov 2009 05:48 AM
That made it! I understand I have some learning to do. Thanks. Now I can try out the Stylus Studio to see if it will be of use to me, - and I think it will.
:-)arjo

   
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.