From davidbowie2nl at yahoo.com Thu Jul 2 09:44:09 2009 From: davidbowie2nl at yahoo.com (T Benjamins) Date: Thu, 2 Jul 2009 06:44:09 -0700 (PDT) Subject: [XOM-interest] xpathcontext question Message-ID: <715076.76473.qm@web50906.mail.re2.yahoo.com> Hello, I was wondering if it's possible to a Xpathcontext.listamespaces(xpathcontext) method, which returns an iterator of the private namespaces hashmap inside an XPathContext instance. greetings, Tom Benjamins From elharo at ibiblio.org Thu Jul 2 10:05:26 2009 From: elharo at ibiblio.org (Elliotte Harold) Date: Thu, 2 Jul 2009 07:05:26 -0700 Subject: [XOM-interest] xpathcontext question In-Reply-To: <715076.76473.qm@web50906.mail.re2.yahoo.com> References: <715076.76473.qm@web50906.mail.re2.yahoo.com> Message-ID: <654a2bb30907020705m41473cc3haff062e525cdf7a8@mail.gmail.com> On Thu, Jul 2, 2009 at 6:44 AM, T Benjamins wrote: > Hello, > > I was wondering if it's possible to a Xpathcontext.listamespaces(xpathcontext) method, which returns an iterator of the private namespaces hashmap > inside an XPathContext instance. > What's the use case? -- Elliotte Rusty Harold elharo at ibiblio.org From elharo at ibiblio.org Sat Jul 11 23:11:53 2009 From: elharo at ibiblio.org (Elliotte Harold) Date: Sat, 11 Jul 2009 20:11:53 -0700 Subject: [XOM-interest] XOM 1.2.2 beta 4 Message-ID: <654a2bb30907112011h626bc163ibad73567c855801a@mail.gmail.com> I've uploaded XOM 1.2.2b4 to the usual location: http://www.xom.nu/unstable.html I hope this fixes the various issues with OSGI that have been reported, and marks JUnit as optional as numerous folks requested. However I still have no plausible means of automatically testing this, and thus I have very little confidence. What I need is an automated JUnit test that verifies the correctness of the bundle, preferably without introducing large additional dependencies. If that's not possible, I'm inclined to drop the OSGI support completely. It's been a colossal hassle that has significantly delayed this release, and it seems likely to continue to cause problems in the future. I'm really not sure it's worth the additional complexity. -- Elliotte Rusty Harold elharo at ibiblio.org From paulk at asert.com.au Thu Jul 16 08:40:18 2009 From: paulk at asert.com.au (Paul King) Date: Thu, 16 Jul 2009 22:40:18 +1000 Subject: [XOM-interest] XOM 1.2.2 beta 4 In-Reply-To: <654a2bb30907112011h626bc163ibad73567c855801a@mail.gmail.com> References: <654a2bb30907112011h626bc163ibad73567c855801a@mail.gmail.com> Message-ID: <4A5F1FB2.7030408@asert.com.au> Elliotte Harold wrote: > I've uploaded XOM 1.2.2b4 to the usual location: http://www.xom.nu/unstable.html > > I hope this fixes the various issues with OSGI that have been > reported, and marks JUnit as optional as numerous folks requested. > However I still have no plausible means of automatically testing this, > and thus I have very little confidence. What I need is an automated > JUnit test that verifies the correctness of the bundle, preferably > without introducing large additional dependencies. If that's not > possible, I'm inclined to drop the OSGI support completely. It's been > a colossal hassle that has significantly delayed this release, and it > seems likely to continue to cause problems in the future. I'm really > not sure it's worth the additional complexity. > It seemed to work for me. The exports have no version number which has sometimes caused me problems in the past but I tested this with felix this time around and it didn't seem to need them. You might consider the suggestion on OSGi testing from here: http://www.talios.com/osgi_based_integration_testing_with_testng_and_apache_felix.htm I borrowed that concept but wrapped it in a little Groovy script so that I run without TestNG or Maven. I placed the xom jar in ~/xom/xom-1.2.2b4.jar and then cut and paste the following script into a recent (1.7-beta-snapshot) version of GroovyConsole. It downloads felix, creates an activator bundle, runs the bundle (which prints out an exemplar class name - which hopefully confirms there are no classloader issues) and then checks that all the bundles are Active for good measure. Perhaps you can borrow ideas from this or the above reference to make a suitable test. I also have a version of this script without the @Grab annotation which is suitable for use within a more typical source environment where you have downloaded felix manually. Happy to share that with you if you prefer. Output of the script below is something like: [javac] Compiling 1 source file to C:\Users\paulk\build [jar] Building jar: C:\Users\paulk\build\XomHello.jar nu.xom.Info on Windows but hopefully should work cross platform. Cheers, Paul. ---------------------------->8---------------------------- import org.apache.felix.framework.util.StringMap import org.apache.felix.framework.Felix import static org.osgi.framework.Bundle.ACTIVE import static org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES @Grab(group='org.apache.felix', module='org.apache.felix.framework', version='1.8.1') def getFelixDir(){ new File(System.getProperty('user.home'), '.groovy/grapes/org.apache.felix/org.apache.felix.framework/bundles').toURI().path + 'org.apache.felix.framework-1.8.1.jar' } def userHome = new File(System.getProperty('user.home')).toURI().path def buildDir = new File(userHome, 'build').canonicalPath def ant = new AntBuilder() ant.with { mkdir dir:"$buildDir/xom" echo file:"$buildDir/xom/XomHelloActivator.java", ''' package xom; import org.osgi.framework.*; public class XomHelloActivator implements BundleActivator { public void start(BundleContext context) throws Exception { System.out.println("Found class: " + Class.forName("nu.xom.Info").getName()); } public void stop(BundleContext context) throws Exception { } } ''' javac srcdir:buildDir, includes:'**/*.java', destdir:buildDir, classpath:felixDir jar destfile:"$buildDir/XomHello.jar", basedir:buildDir, includes:'**/*.class', { manifest { attribute name:'Export-Package', value:'xom;version="1.0.0"' attribute name:'Bundle-Activator', value:'xom.XomHelloActivator' attribute name:'Import-Package', value:'xom;version="1.0.0",org.w3c.dom,org.osgi.framework;version="1.3.0",nu.xom;version="1.2.2.b4"' } } } def configMap = new StringMap(false) configMap[FRAMEWORK_SYSTEMPACKAGES] = ''' org.osgi.framework; version=1.3.0, org.osgi.service.packageadmin; version=1.2.0, org.osgi.service.startlevel; version=1.0.0, org.osgi.service.url; version=1.0.0, org.w3c.dom, org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers, javax.xml.transform.sax, javax.xml.transform ''' def m_felix = new Felix(configMap) m_felix.start() def bundleContext = m_felix.bundleContext bundleContext.installBundle("file://${userHome}xom/xom-1.2.2b4.jar").start() bundleContext.installBundle("file://${userHome}build/XomHello.jar").start() bundleContext.bundles.each { assert it.state == ACTIVE: "Bundle $it.symbolicName is not started." } m_felix.stop() ---------------------------->8---------------------------- From goodieboy at gmail.com Sat Jul 18 20:29:36 2009 From: goodieboy at gmail.com (Matt Mitchell) Date: Sat, 18 Jul 2009 20:29:36 -0400 Subject: [XOM-interest] dom - how to get xpath of a node Message-ID: Hi, I'm indexing some xml into a search engine and would like to store the xpath of the nodes i'm indexing. Is this currently possible with the dom api? If not, anyone want to give me a hint as to how I'd do this? Thanks! Matt From elharo at ibiblio.org Sun Jul 19 08:49:48 2009 From: elharo at ibiblio.org (Elliotte Rusty Harold) Date: Sun, 19 Jul 2009 05:49:48 -0700 Subject: [XOM-interest] dom - how to get xpath of a node In-Reply-To: References: Message-ID: <654a2bb30907190549p799d4a27q8d92078c414160f9@mail.gmail.com> On Sat, Jul 18, 2009 at 5:29 PM, Matt Mitchell wrote: > Hi, > > I'm indexing some xml into a search engine and would like to store the xpath > of the nodes i'm indexing. Is this currently possible with the dom api? If > not, anyone want to give me a hint as to how I'd do this? > There's no specific feature to do that. Nor is there one XPath for a node. I suppose theoretically there are an infinite number of such paths. It shouldn't be too hard to find an XPath for a node. -- Elliotte Rusty Harold elharo at ibiblio.org From goodieboy at gmail.com Sun Jul 19 10:08:42 2009 From: goodieboy at gmail.com (Matt Mitchell) Date: Sun, 19 Jul 2009 10:08:42 -0400 Subject: [XOM-interest] dom - how to get xpath of a node In-Reply-To: <654a2bb30907190549p799d4a27q8d92078c414160f9@mail.gmail.com> References: <654a2bb30907190549p799d4a27q8d92078c414160f9@mail.gmail.com> Message-ID: Thanks Elliotte. you're right, that should be pretty easy to do. fyi - I'm working on some jruby helpers for XOM and NUX here: http://github.com/mwmitchell/jrx Also, I'm new to java and was wondering if you could tell me what the most popular and active XML lib for java is? Is it XOM? I need xslt 2.0 and xpath essentially. Thanks again! Sent from my iPhone On Jul 19, 2009, at 8:49 AM, Elliotte Rusty Harold wrote: > On Sat, Jul 18, 2009 at 5:29 PM, Matt Mitchell > wrote: >> Hi, >> >> I'm indexing some xml into a search engine and would like to store >> the xpath >> of the nodes i'm indexing. Is this currently possible with the dom >> api? If >> not, anyone want to give me a hint as to how I'd do this? >> > > There's no specific feature to do that. Nor is there one XPath for a > node. I suppose theoretically there are an infinite number of such > paths. It shouldn't be too hard to find an XPath for a node. > > -- > Elliotte Rusty Harold > elharo at ibiblio.org > _______________________________________________ > XOM-interest mailing list > XOM-interest at lists.ibiblio.org > http://lists.ibiblio.org/mailman/listinfo/xom-interest From elharo at ibiblio.org Sun Jul 19 10:13:14 2009 From: elharo at ibiblio.org (Elliotte Rusty Harold) Date: Sun, 19 Jul 2009 07:13:14 -0700 Subject: [XOM-interest] dom - how to get xpath of a node In-Reply-To: References: <654a2bb30907190549p799d4a27q8d92078c414160f9@mail.gmail.com> Message-ID: <654a2bb30907190713h27be79eex7853628b630b5278@mail.gmail.com> On Sun, Jul 19, 2009 at 7:08 AM, Matt Mitchell wrote: > Also, I'm new to java and was wondering if you could tell me what the > most popular and active XML lib for java is? Is it XOM? I need xslt > 2.0 and xpath essentially. The only option I know for XSLT 2 and XPath 2 in Java is Saxon. -- Elliotte Rusty Harold elharo at ibiblio.org From jasonrbriggs at gmail.com Mon Jul 27 18:28:21 2009 From: jasonrbriggs at gmail.com (Jason Briggs) Date: Mon, 27 Jul 2009 23:28:21 +0100 Subject: [XOM-interest] Projects using XOM Message-ID: <76495437-9149-4BE5-BCFF-0A5BA91BF89C@gmail.com> Hi Rusty I'm using XOM in the Java version of a small (very small) open source project (an xml/xhtml templating engine called Proton, see http://code.google.com/p/proton-te) . It's working well, and made the translation from Python relatively painless (thanks for that... ;-) Perhaps you might like to add it to your "Projects using XOM" list? Regards Jason From mike at saxonica.com Thu Jul 30 18:25:44 2009 From: mike at saxonica.com (Michael Kay) Date: Thu, 30 Jul 2009 23:25:44 +0100 Subject: [XOM-interest] Bad links Message-ID: The XOM Release Notes page http://www.xom.nu/history.html under "Downloads", has links to old versions that don't exist on the server (xom1.0b11) Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay