From tjf at tfinney.net Wed Aug 10 09:02:04 2011 From: tjf at tfinney.net (Tim Finney) Date: Wed, 10 Aug 2011 13:02:04 -0300 Subject: [xquery-talk] Extend and override Message-ID: <1312992124.1529.90.camel@tim-desktop> Hi Everyone, I'm interested to know how to do extension and override. Say I have a set of generic library modules that do generally useful things that I might use over and over again. Let's call them model.xqy, view.xqy, and controller.xqy just for fun. Now, let's say that I also have particular versions of these modules, say, model-p.xqy, view-p.xqy, and controller-p.xqy which may or may not extend function definitions in the corresponding general modules. The particular modules might even define entirely new functions. What I'd like is to be able to use the function interface (signature) defined in a general module to constrain the corresponding function in the particular module. That is, I want to guarantee that a function in a particular module has the same signature as the corresponding one in the general module, preferably in some automatic way besides generating an error at run time. More importantly, I want to be able to extend or override what a general function does by changing the body of the corresponding particular function. That is, if there is a definition of a function in a particular module then the system knows that it should use this definition of the function rather than the corresponding one in the general module. I'd also like the same things to happen with variables: if one is defined in a particular module then it must conform to the type of the corresponding variable in the general module and the system must know that, if a variable is defined in a particular module, the value overrides what is in the general module for that variable. Can it be done in an elegant and bomb proof way? I'd like to know whether any of you know about good general approaches in this area. Best, Tim Finney From dlee at calldei.com Wed Aug 10 09:06:04 2011 From: dlee at calldei.com (David Lee) Date: Wed, 10 Aug 2011 12:06:04 -0400 Subject: [xquery-talk] Extend and override In-Reply-To: <1312992124.1529.90.camel@tim-desktop> References: <1312992124.1529.90.camel@tim-desktop> Message-ID: <009b01cc5777$688ede60$39ac9b20$@calldei.com> I don't believe this can be done using XQuery 1.0. Maybe function items might accommodate some of this in XQuery 3 ... but not statically. If I'm wrong I'd love to hear about it! ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Tim Finney Sent: Wednesday, August 10, 2011 12:02 PM To: talk at x-query.com Subject: [xquery-talk] Extend and override Hi Everyone, I'm interested to know how to do extension and override. Say I have a set of generic library modules that do generally useful things that I might use over and over again. Let's call them model.xqy, view.xqy, and controller.xqy just for fun. Now, let's say that I also have particular versions of these modules, say, model-p.xqy, view-p.xqy, and controller-p.xqy which may or may not extend function definitions in the corresponding general modules. The particular modules might even define entirely new functions. What I'd like is to be able to use the function interface (signature) defined in a general module to constrain the corresponding function in the particular module. That is, I want to guarantee that a function in a particular module has the same signature as the corresponding one in the general module, preferably in some automatic way besides generating an error at run time. More importantly, I want to be able to extend or override what a general function does by changing the body of the corresponding particular function. That is, if there is a definition of a function in a particular module then the system knows that it should use this definition of the function rather than the corresponding one in the general module. I'd also like the same things to happen with variables: if one is defined in a particular module then it must conform to the type of the corresponding variable in the general module and the system must know that, if a variable is defined in a particular module, the value overrides what is in the general module for that variable. Can it be done in an elegant and bomb proof way? I'd like to know whether any of you know about good general approaches in this area. Best, Tim Finney _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Wed Aug 10 10:30:16 2011 From: mike at saxonica.com (Michael Kay) Date: Wed, 10 Aug 2011 18:30:16 +0100 Subject: [xquery-talk] Extend and override In-Reply-To: <1312992124.1529.90.camel@tim-desktop> References: <1312992124.1529.90.camel@tim-desktop> Message-ID: <4E42C028.5040806@saxonica.com> On 10/08/2011 17:02, Tim Finney wrote: > Hi Everyone, > > I'm interested to know how to do extension and override. With XSLT ;-) Seriously, I did a consultancy assignment with a big XQuery user and this was a major hassle. We invented some kind of machinery for building a query using variant versions of a library module to handle different scenarios, but we had to decide up front which version of the query to use in each run-time situation so it wasn't much fun. > > Can it be done in an elegant and bomb proof way? I'd like to know > whether any of you know about good general approaches in this area. > In XQuery 3.0 we have dynamic function items and some of us still have hopes that we might get maps. (If maps aren't in the standard, they will certainly be in many implementations). With a map of function items you have something akin to a weakly-typed object as in Javascript, and you can use it to do dynamic despatch. It doesn't provide all that you are asking for, but at least there is no longer a brick wall. Michael Kay Saxonica From tjf at tfinney.net Wed Aug 10 12:15:44 2011 From: tjf at tfinney.net (Tim Finney) Date: Wed, 10 Aug 2011 16:15:44 -0300 Subject: [xquery-talk] Extend and override In-Reply-To: <4E42C028.5040806@saxonica.com> References: <1312992124.1529.90.camel@tim-desktop> <4E42C028.5040806@saxonica.com> Message-ID: <1313003744.1529.119.camel@tim-desktop> Hi Michael, Thank you for your reply. It helps me know that there is no obvious solution. A philosophical question with no need for an answer: What is the distance between XQuery 3.0 and Lisp? Best, Tim Finney On Wed, 2011-08-10 at 18:30 +0100, Michael Kay wrote: > On 10/08/2011 17:02, Tim Finney wrote: > > Hi Everyone, > > > > I'm interested to know how to do extension and override. > With XSLT ;-) > > Seriously, I did a consultancy assignment with a big XQuery user and > this was a major hassle. We invented some kind of machinery for building > a query using variant versions of a library module to handle different > scenarios, but we had to decide up front which version of the query to > use in each run-time situation so it wasn't much fun. > > > > Can it be done in an elegant and bomb proof way? I'd like to know > > whether any of you know about good general approaches in this area. > > > In XQuery 3.0 we have dynamic function items and some of us still have > hopes that we might get maps. (If maps aren't in the standard, they will > certainly be in many implementations). With a map of function items you > have something akin to a weakly-typed object as in Javascript, and you > can use it to do dynamic despatch. It doesn't provide all that you are > asking for, but at least there is no longer a brick wall. > > Michael Kay > Saxonica > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Wed Aug 10 13:01:14 2011 From: dlee at calldei.com (David Lee) Date: Wed, 10 Aug 2011 16:01:14 -0400 Subject: [xquery-talk] Extend and override In-Reply-To: <1313003744.1529.119.camel@tim-desktop> References: <1312992124.1529.90.camel@tim-desktop> <4E42C028.5040806@saxonica.com> <1313003744.1529.119.camel@tim-desktop> Message-ID: <00c601cc5798$43539b60$c9fad220$@calldei.com> Great question about Lisp. I would offer to suggest besides comparing Apples to Airplanes ... that until XQuery gets nested sequences the distance is far by any metric. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Tim Finney Sent: Wednesday, August 10, 2011 3:16 PM To: Michael Kay Cc: talk at x-query.com Subject: Re: [xquery-talk] Extend and override Hi Michael, Thank you for your reply. It helps me know that there is no obvious solution. A philosophical question with no need for an answer: What is the distance between XQuery 3.0 and Lisp? Best, Tim Finney On Wed, 2011-08-10 at 18:30 +0100, Michael Kay wrote: > On 10/08/2011 17:02, Tim Finney wrote: > > Hi Everyone, > > > > I'm interested to know how to do extension and override. > With XSLT ;-) > > Seriously, I did a consultancy assignment with a big XQuery user and > this was a major hassle. We invented some kind of machinery for building > a query using variant versions of a library module to handle different > scenarios, but we had to decide up front which version of the query to > use in each run-time situation so it wasn't much fun. > > > > Can it be done in an elegant and bomb proof way? I'd like to know > > whether any of you know about good general approaches in this area. > > > In XQuery 3.0 we have dynamic function items and some of us still have > hopes that we might get maps. (If maps aren't in the standard, they will > certainly be in many implementations). With a map of function items you > have something akin to a weakly-typed object as in Javascript, and you > can use it to do dynamic despatch. It doesn't provide all that you are > asking for, but at least there is no longer a brick wall. > > Michael Kay > Saxonica > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From scott at tnstaafl.net Mon Aug 15 12:17:43 2011 From: scott at tnstaafl.net (Scott Derrick) Date: Mon, 15 Aug 2011 13:17:43 -0600 Subject: [xquery-talk] Java throwing java.net.SocketException when parsing xslt file with Saxon? Message-ID: <4E4970D7.6070901@tnstaafl.net> Ubuntu 10.4 AMD64 Java 1.6.0_26 SaxonHE-9.3.0.5 I am using a very simple script To extract text content from html files Running this script from within Oxygen, it runs fine and produces the expected output. Running this script on the same machine form the command line like so java -jar lib/saxonHE-9.3.0.5.jar -o:build/etemp/html_1.txt -s:build/ebook/epub_sh-tei.html -xsl:xslt/htm2text.xsl produces the following error and no output. Error java.net.SocketException: Unexpected end of file from server Transformation failed: Run-time errors were reported It seems odd that using the same version of Java and Saxon would be fine in Oxygen and not on the command line? thanks, Scott From scott at tnstaafl.net Mon Aug 15 12:21:58 2011 From: scott at tnstaafl.net (Scott Derrick) Date: Mon, 15 Aug 2011 13:21:58 -0600 Subject: [xquery-talk] Java throwing java.net.SocketException when parsing xslt file with Saxon? Message-ID: <4E4971D6.4090909@tnstaafl.net> Ubuntu 10.4 AMD64 Java 1.6.0_26 SaxonHE-9.3.0.5 I am using a very simple script To extract text content from html files Running this script from within Oxygen, it runs fine and produces the expected output. Running this script on the same machine form the command line like so java -jar lib/saxonHE-9.3.0.5.jar -o:build/etemp/html_1.txt -s:build/ebook/epub_sh-tei.html -xsl:xslt/htm2text.xsl produces the following error and no output. Error java.net.SocketException: Unexpected end of file from server Transformation failed: Run-time errors were reported It seems odd that using the same version of Java and Saxon would be fine in Oxygen and not on the command line? thanks, Scott -- Sin makes its own hell, and goodness its own heaven. Mary Baker Eddy From andrew.j.welch at gmail.com Mon Aug 15 12:42:58 2011 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 15 Aug 2011 20:42:58 +0100 Subject: [xquery-talk] Java throwing java.net.SocketException when parsing xslt file with Saxon? In-Reply-To: <4E4970D7.6070901@tnstaafl.net> References: <4E4970D7.6070901@tnstaafl.net> Message-ID: On 15 August 2011 20:17, Scott Derrick wrote: > Ubuntu 10.4 ?AMD64 > Java 1.6.0_26 > SaxonHE-9.3.0.5 > > I am using a very simple script > > > ? ? ?xmlns:html="http://www.w3.org/1999/html" > ? ? ?version="2.0"> > > > > > > To extract text content from html files > > Running this script from within Oxygen, it runs fine and produces the > expected output. > > Running this script on the same machine form the command line like so > > ?java ?-jar lib/saxonHE-9.3.0.5.jar -o:build/etemp/html_1.txt > -s:build/ebook/epub_sh-tei.html -xsl:xslt/htm2text.xsl > > produces the following error and no output. > > Error > ?java.net.SocketException: Unexpected end of file from server > Transformation failed: Run-time errors were reported > > It seems odd that using the same version of Java and Saxon would be fine in > Oxygen and not on the command line? hmmm guessing it could be dtd related, perhaps oxygen is using a cached copy of the xhtml dtd but outside of oxygen the xml parser is trying to fetch it? -- Andrew Welch http://andrewjwelch.com From mike at saxonica.com Mon Aug 15 13:58:29 2011 From: mike at saxonica.com (Michael Kay) Date: Mon, 15 Aug 2011 21:58:29 +0100 Subject: [xquery-talk] Java throwing java.net.SocketException when parsing xslt file with Saxon? In-Reply-To: <4E4970D7.6070901@tnstaafl.net> References: <4E4970D7.6070901@tnstaafl.net> Message-ID: <4E498875.6010706@saxonica.com> I can't see why you're raising an XSLT question on this list - especially one that is clearly product-specific. You've asked the same question on the Saxon help list, and I shall answer it there. Michael Kay Saxonica On 15/08/2011 20:17, Scott Derrick wrote: > Ubuntu 10.4 AMD64 > Java 1.6.0_26 > SaxonHE-9.3.0.5 > > I am using a very simple script > > > xmlns:html="http://www.w3.org/1999/html" > version="2.0"> > > > > > > To extract text content from html files > > Running this script from within Oxygen, it runs fine and produces the > expected output. > > Running this script on the same machine form the command line like so > > java -jar lib/saxonHE-9.3.0.5.jar -o:build/etemp/html_1.txt > -s:build/ebook/epub_sh-tei.html -xsl:xslt/htm2text.xsl > > produces the following error and no output. > > Error > java.net.SocketException: Unexpected end of file from server > Transformation failed: Run-time errors were reported > > It seems odd that using the same version of Java and Saxon would be > fine in Oxygen and not on the command line? > > thanks, > > Scott > > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From john.snelson at marklogic.com Tue Aug 16 03:57:37 2011 From: john.snelson at marklogic.com (John Snelson) Date: Tue, 16 Aug 2011 11:57:37 +0100 Subject: [xquery-talk] Get the context item form function In-Reply-To: References: Message-ID: <4E4A4D21.4050404@marklogic.com> The context item is not available inside a function - you'll have to pass it in explicitly as an argument: declare function local:main($context) as element()*{ let $items := $context//item return $items }; { local:main(.) } John On 16/08/11 11:41, Stefan Ivanov wrote: > Hi > > I'm using saxon 9.1.0.8 and trying to implement a XQuery processor. > I use the XQJ API. > > I have a simple XQuery declaring a function. The declared function is > called from the body without any parameters as follows: > > -- start snippet -- > declare function local:main() as element()*{ > let $items := //item > return $items > }; > > { > local:main() > } > -- end snippet -- > > Executing this from some XML tool is o.k. but from the my Java Processor > the result ist: XPDY0002: The context item is undefined at this point > The exception is thrown when the expression is loaded > > My JAVA Code look like this: > -- start snippet -- > ... > XQConnection conn = ds.getConnection(); > XQPreparedExpression exp = conn.prepareExpression( stream>); > exp.bindDocument(XQConstants.CONTEXT_ITEM, , null); > XQResultSequence somer = exp.executeQuery(); > ... > -- end snippet -- > > If I try to bind the as external document-node() > variable and reference this node from the function the query is > evaluated successfully: > > -- start snippet -- > declare variable $somedoc as document-node() external; > > declare function local:main() as element()*{ > let $item:= $somedoc//item > return $item > }; > ... > -- end snippet -- > > I tried also to ref the context with the doc(.) function but for now I'm > unsuccessful. > Any help is appreciated. > -- John Snelson, Senior Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From andrew.j.welch at gmail.com Tue Aug 16 03:59:00 2011 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 16 Aug 2011 11:59:00 +0100 Subject: [xquery-talk] Get the context item form function In-Reply-To: References: Message-ID: > I have a simple XQuery declaring a function. The declared function is called > from the body without any parameters as follows: > > -- start snippet -- > declare function local:main() as element()*{ > ??? let $items := //item > ??? return $items > }; > > { > local:main() > } > result ist: XPDY0002: The context item is undefined at this point > The exception is thrown when the expression is loaded You have to pass the context to the function as a parameter.... > declare variable $somedoc as document-node() external; or change that to: declare variable $somedoc as document-node() := doc('foo.xml'); so the query pulls in the xml itself, but it's still a good idea pass $somedoc to the function rather just reference the global from within the function. -- Andrew Welch http://andrewjwelch.com From adam.retter at googlemail.com Thu Aug 18 10:07:43 2011 From: adam.retter at googlemail.com (Adam Retter) Date: Thu, 18 Aug 2011 19:07:43 +0200 Subject: [xquery-talk] XQuery Meetup London (17th Sept) Message-ID: The second London XQuery Meetup is now confirmed for the 17th September, the details can be found here - http://xquery.pbworks.com/w/page/42445099/London%20Meetup%202 Please feel free to come along, and if you have a spare moment then promote it by Tweet'ing or whatever your preferred communications mechanism is. Cheers Adam. -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.j.welch at gmail.com Mon Aug 22 05:48:47 2011 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 22 Aug 2011 13:48:47 +0100 Subject: [xquery-talk] Referencing a document from within a query In-Reply-To: References: Message-ID: > Is it possible to perform a XQuery that references nodes that reside in a > document which contains the query which is being processed? > Here is an example: > I need to select the nodes named "title" which have an attribute "lang" > equal to value of attribute node /data/lang/@name in the document where the > query is declared: > > > ??? > ??? > ??? { > ??????? for $x in collection("books")//title[ > compare(@lang, doc(.)/data/lang/@name) = 0 ] > ??????? return $x/title > ??? } > ??? > You could/should treat it as a normal xquery instead of an xml document and then do: let $lang := 'en'; return { collection("books")//title[@lang = $lang]/title } -- Andrew Welch http://andrewjwelch.com From sudheshnaiyer at yahoo.com Fri Aug 26 06:44:22 2011 From: sudheshnaiyer at yahoo.com (sudheshna iyer) Date: Fri, 26 Aug 2011 06:44:22 -0700 (PDT) Subject: [xquery-talk] Xquery help to add element to loop Message-ID: <1314366262.74827.YahooMailNeo@web125801.mail.ne1.yahoo.com> I want to prepare an element of complex type and add it to the list of elements. How can I achieve this in xquery? I am using oepe.. ? My input.xml needs to be transformed into output.xml.? Please note that values of element ?should be part of the list =========== Input.xml ? ??3 ??haa ??hbb ? ? ??
???1 ???aa ???bb ??
??
???2 ???aa ???bb ??
?
=========== Output: ? ?? ???1 ???aa ???bb ?? ?? ???2 ???aa ???bb ?? ?? ???3 ???haa ???hbb ?? ? From loren.cahlander at gmail.com Fri Aug 26 08:55:54 2011 From: loren.cahlander at gmail.com (Loren Cahlander) Date: Fri, 26 Aug 2011 10:55:54 -0500 Subject: [xquery-talk] looking for XQuery code to detect mobile devices and type of mobile device References: Message-ID: Has anyone out there already written a function module to detect a mobile device and the type of mobile device? I am planning on making my site mobile aware so that it can make the best use of the screen resolution and orientation. Has anyone already written such code? Thanks, Loren From wcandillon at gmail.com Fri Aug 26 08:58:55 2011 From: wcandillon at gmail.com (William Candillon) Date: Fri, 26 Aug 2011 17:58:55 +0200 Subject: [xquery-talk] looking for XQuery code to detect mobile devices and type of mobile device In-Reply-To: References: Message-ID: Hello Loren, There is an xquery app that demo such scenario: http://balisage.my28msec.com/index.html. I hope this helps. Best, William On Fri, Aug 26, 2011 at 5:55 PM, Loren Cahlander wrote: > > Has anyone out there already written a function module to detect a mobile device and the type of mobile device? > > I am planning on making my site mobile aware so that it can make the best use of the screen resolution and orientation. ?Has anyone already written such code? > > Thanks, > > Loren > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From adam.retter at googlemail.com Fri Aug 26 09:11:39 2011 From: adam.retter at googlemail.com (Adam Retter) Date: Fri, 26 Aug 2011 18:11:39 +0200 Subject: [xquery-talk] looking for XQuery code to detect mobile devices and type of mobile device In-Reply-To: References: Message-ID: Can you not get this info from the http headers? On 26 August 2011 17:55, Loren Cahlander wrote: > > Has anyone out there already written a function module to detect a mobile device and the type of mobile device? > > I am planning on making my site mobile aware so that it can make the best use of the screen resolution and orientation. ?Has anyone already written such code? > > Thanks, > > Loren > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From loren.cahlander at gmail.com Fri Aug 26 09:25:15 2011 From: loren.cahlander at gmail.com (Loren Cahlander) Date: Fri, 26 Aug 2011 11:25:15 -0500 Subject: [xquery-talk] looking for XQuery code to detect mobile devices and type of mobile device In-Reply-To: References: Message-ID: I can. I was wondering if someone had already written something and made it available. On Aug 26, 2011, at 11:11 AM, Adam Retter wrote: > Can you not get this info from the http headers? > > On 26 August 2011 17:55, Loren Cahlander wrote: >> >> Has anyone out there already written a function module to detect a mobile device and the type of mobile device? >> >> I am planning on making my site mobile aware so that it can make the best use of the screen resolution and orientation. Has anyone already written such code? >> >> Thanks, >> >> Loren >> >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> > > > > -- > Adam Retter > > skype: adam.retter > tweet: adamretter > http://www.adamretter.org.uk From rpbourret at rpbourret.com Fri Aug 26 14:14:26 2011 From: rpbourret at rpbourret.com (Ronald Bourret) Date: Fri, 26 Aug 2011 14:14:26 -0700 Subject: [xquery-talk] Base Xq and extend base to have subclass xqs In-Reply-To: <1314384862.63427.YahooMailNeo@web125817.mail.ne1.yahoo.com> References: <1314384862.63427.YahooMailNeo@web125817.mail.ne1.yahoo.com> Message-ID: <4E580CB2.1010008@rpbourret.com> The short answer is that XQuery does not support subclassing. One possible workaround is to create functions that do your mapping and use these in your "extended" queries. Depending on what you want to do, this may or may not work easily (or at all). For more ideas, see the thread, "Extend and override" in: http://x-query.com/pipermail/talk/2011-August/thread.html -- Ron sudheshna iyer wrote: > I have 200 elements in one xsd. > I have to use this xsd to create 6 xquery maps. All of these xqs have 100 elements in common. > I want to create one xquery with 100 elements and call that in rest of the 5 xqueries. I don't want to copy the mappings from base xq to rest of 5 xqs. > I want the functionality similar to java where we create a base class and extend it to create sub classes. > eg: xsd with following elements: > In the eg below, > > name1 > 111-222-3333 > >
> aa >
>
> > 111 > >
> > Base.xq: -> This will only take care of Name and Phone > > name1 > 111-222-3333 > > Sub xq: Extend Base and Add additional functionality > Sub1.xq -> This will only take care of address mapping > > >
> aa >
>
>
> Sub2.xq -> -> This will only take care of payment mapping > > > 111 > > > Result: > Base1.xq + Sub2.xq.xq + Sub1.xq > > name1 > 111-222-3333 > >
> aa >
>
> > 111 > >
> My question again is can we create subclass of base xquery to inherit the mappings that are already done in base query. > > > ------------------------------------------------------------------------ > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From andrew.j.welch at gmail.com Sat Aug 27 00:47:02 2011 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Sat, 27 Aug 2011 08:47:02 +0100 Subject: [xquery-talk] Base Xq and extend base to have subclass xqs In-Reply-To: <1314384862.63427.YahooMailNeo@web125817.mail.ne1.yahoo.com> References: <1314384862.63427.YahooMailNeo@web125817.mail.ne1.yahoo.com> Message-ID: On 26 August 2011 19:54, sudheshna iyer wrote: > I have 200? elements in? one xsd. > I have to use this xsd to create 6 xquery maps. All of these xqs have 100 > elements in common. > I want to create one xquery with 100 elements and call that in rest of the 5 > xqueries. I don't want to copy the mappings from base xq to rest of 5 xqs. Ok, you can create the 5 XQueries and in each one import a common XQuery module. > I want the functionality similar to java where we create a base class and > extend it to create sub classes. The way you describe the problem it doesn't sound like that is what you need... do you need to override functionality in the base class? -- Andrew Welch http://andrewjwelch.com From adam.retter at googlemail.com Wed Aug 31 09:36:41 2011 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 31 Aug 2011 18:36:41 +0200 Subject: [xquery-talk] Need to generate an empty instance from an XML Schema In-Reply-To: References: Message-ID: If you don't mind some java, trang can do this for you... On Aug 31, 2011 5:33 PM, "Loren Cahlander" wrote: > Hello folks, > > Has anyone developed a transform to take an XML Schema and create an XML document with empty elements and attributes that adheres to the schema? > > I have an example schema here: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thank you, > Loren > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george at oxygenxml.com Wed Aug 31 12:27:52 2011 From: george at oxygenxml.com (George Cristian Bina) Date: Wed, 31 Aug 2011 22:27:52 +0300 Subject: [xquery-talk] Need to generate an empty instance from an XML Schema In-Reply-To: References: Message-ID: <4E5E8B38.6040604@oxygenxml.com> Hi Loren, Trang also does not offer a set of XML documents as output... What you need is an XML Schema instance generator - we have this support in oXygen: short video demo http://www.oxygenxml.com/demo/Generate_Sample_XML_Files.html user guide related topics http://www.oxygenxml.com/doc/ug-developerEclipse/topics/preferences-xml-instances-generator.html http://www.oxygenxml.com/doc/ug-developer/topics/xml-schema-inst-gener-command-line.html Best Regards, George -- George Cristian Bina XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/31/11 7:50 PM, Loren Cahlander wrote: > The only problem with that is that trang only supports W3C XML Schema > for output: > >> A schema written in any of the supported schema languages can be >> converted into any of the other supported schema languages, except >> that W3C XML Schema is supported for output only, not for input. >> > > > On Aug 31, 2011, at 11:36 AM, Adam Retter wrote: > >> If you don't mind some java, trang can do this for you... >> > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From adam.retter at googlemail.com Wed Aug 31 13:38:35 2011 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 31 Aug 2011 22:38:35 +0200 Subject: [xquery-talk] Need to generate an empty instance from an XML Schema In-Reply-To: <4E5E8B38.6040604@oxygenxml.com> References: <4E5E8B38.6040604@oxygenxml.com> Message-ID: Ah my mistake, I did know that Oxygen did this, and I presumptuously assumed that it was using Trang internally , obviously I got some wires crossed in my brain - as you are correct, it appears that trang does not offer this functionality. If oXygen is not available I do have some Java code which I could maybe dig up, which creates a simple in-memory tree of an XML Schema and allows you to plugin any sort of serializer that you want, there are a couple already that I wrote for shredding Schemas into simple models for relational databases with that code, but it would be trivial to have it generate an XML instance document. Its original purposing was for generating diff information between two versions of a Schema, when it had devised every possible path of instance expression of the Schema, and this was output as either XML or a sequence of SQL Insert/update statements. On 31 August 2011 21:27, George Cristian Bina wrote: > Hi Loren, > > Trang also does not offer a set of XML documents as output... What you need > is an XML Schema instance generator - we have this support in oXygen: > > short video demo > http://www.oxygenxml.com/demo/Generate_Sample_XML_Files.html > > user guide related topics > http://www.oxygenxml.com/doc/ug-developerEclipse/topics/preferences-xml-instances-generator.html > http://www.oxygenxml.com/doc/ug-developer/topics/xml-schema-inst-gener-command-line.html > > Best Regards, > George > -- > George Cristian Bina > XML Editor, Schema Editor and XSLT Editor/Debugger > http://www.oxygenxml.com > > On 8/31/11 7:50 PM, Loren Cahlander wrote: >> >> The only problem with that is that trang only supports W3C XML Schema >> for output: >> >>> A schema written in any of the supported schema languages can be >>> converted into any of the other supported schema languages, except >>> that W3C XML Schema is supported for output only, not for input. >>> >> >> >> On Aug 31, 2011, at 11:36 AM, Adam Retter wrote: >> >>> If you don't mind some java, trang can do this for you... >>> >> >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk