Subject: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?
Subject: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"/>
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?
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:
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
Subject: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