Hi Kimbro, Just to clarify: do you mean using XPath over the CORBA layer? Because that's what we have been doing (so that we can integrate into existing C++ software), and we haven't been able to retrieve a material id. Infact we get an APIException thrown, with the message "This Node Cannot Contain This Child."
Is there some other way to retrieve it other than using XPath? Thanks, Barney -----Original Message----- From: Kimbro Staken [mailto:[EMAIL PROTECTED] Sent: 29 April 2002 11:40 To: [EMAIL PROTECTED] Subject: Re: Attribute Values - Yet again On Monday, April 29, 2002, at 03:17 AM, Barney Govan wrote: > > I am aware that Xindice doesn't allow attribute queries as this doesn't > return valid XML, but I was wondering if this will be changed in future > updates of Xindice? > This was not intentional and the engine does actually process the queries as you would expect. The problem is simply that the API has no way to return atomic values without a containing node. This has been slated to be fixed whenever the XML:DB API gets updated (no idea when). It's simply immaturity. In the mean time, as far as I know you should be able to use either XML-RPC or CORBA (CORBA is going away) to get the query result. > Another solution to this problem involves just returning the root node > without any of its children: this would dramatically reduce the network > traffic generated by querying for attributes in the root node. However, I > have not been able to find out if this is possible. Can anyone out there > shed any light on this? If you ask for a node, you'll always get all children. > > Thanks in advance, > > Barney Govan > R&D Engineer > Sony BPE Research Labs > > > > -----Original Message----- > From: Jayaram Narayana [mailto:[EMAIL PROTECTED] > Sent: 18 April 2002 16:13 > To: 'Xindice Dev. Group' > Subject: Attribute Values > > > hi there! > > i need to access the attribute value of an element using the xalan api. my > element is like so: > > <temp att="tempAtt" id="1001"/> > > how do i access the value of "att", given that i already have this code: > > Collection col = > DatabaseManager.getCollection(PageConstants.COLLECTION_PATH); > XPathQueryService service = > (XPathQueryService)col.getService("XPathQueryService", "1.0"); > > ResourceSet resultSet = service.queryResource("proj1", xpath); > > XObject xo = new XObject(); > XMLResource resource = (XMLResource) resultSet.getResource(0); > Node originalnode = resource.getContentAsDOM(); > > // Use Xalan xpath parser to extract data > xo = XPathAPI.eval(originalnode, "/" + xpath); > > // TODO > /* i need to access the attribute values here */ > > TIA, > -nani > > > > > ************************************************************************* > The information contained in this message or any of its > attachments may be privileged and confidential and intended > for the exclusive use of the addressee. If you are not the > addressee any disclosure, reproduction, distribution or other > dissemination or use of this communication is strictly prohibited > ************************************************************************* > > Kimbro Staken Java and XML Software, Consulting and Writing http://www.xmldatabases.org/ Apache Xindice native XML database http://xml.apache.org/xindice XML:DB Initiative http://www.xmldb.org
