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 (2016)
-> - Issue with Processing Instruct... (1)
-> + 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
Muhammad AkramSubject: KEYWORD EXTRACTION FROM XML DOCUMENT
Author: Muhammad Akram
Date: 10 Sep 2007 03:49 PM
HI,
i have imported a relational data into XML file, i have attribute diagnosis, containing a string containing disease symptoms and disease like malaria. All i want is to extract the record that has a malaria in diagnosis field.

I used the XQuery to extract the records using string matching, it works but i do not want to do string Matching.

IS there anyother way to do it using namespaces or metadata of xml document, if yes, please do guide me.

Any help is appreciated

nomi

Postnext
Tony LavinioSubject: KEYWORD EXTRACTION FROM XML DOCUMENT
Author: Tony Lavinio
Date: 10 Sep 2007 05:33 PM
Not knowing what your XML looks like makes it hard to give guidance.

Can you post a SMALL example of the XML document and the expected
output? A copy of the XQuery you are using to do the extraction
might also help.

And which version of Stylus Studio are you using?

Postnext
Muhammad AkramSubject: KEYWORD EXTRACTION FROM XML DOCUMENT
Author: Muhammad Akram
Date: 10 Sep 2007 07:49 PM
HI,
I am using Stylus Studio 2007 Enterprise Suite, and following is part of example code

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE s:sequence []>
<DIAGNOSIS xmlns:s="http://www.stylusstudio.com/xquery">
<CONSULTATION>
<DIAGNOSIS_ID>1</DIAGNOSIS_ID>
<PATIENT_ID>P0001</PATIENT_ID>
<STAFF_ID>St2125</STAFF_ID>
<FINDINGS>Symptoms of high fever cold means he got malaria</FINDINGS>
</CONSULTATION>
<CONSULTATION>
<DIAGNOSIS_ID>2</DIAGNOSIS_ID>
<PATIENT_ID>P0003</PATIENT_ID>
<STAFF_ID>St2125</STAFF_ID>
<FINDINGS>headache and stomachache got fever diagnosed to have typhoid</FINDINGS>
</CONSULTATION>
<CONSULTATION>
<DIAGNOSIS_ID>3</DIAGNOSIS_ID>
<PATIENT_ID>P0005</PATIENT_ID>
<STAFF_ID>St2155</STAFF_ID>
<FINDINGS>Symptoms of high fever cold She got malaria</FINDINGS>
</CONSULTATION>
</DIAGNOSIS>

------------------

. I used simple xPatheQuery as follow..

/DIAGNOSIS/CONSULTATION[contains(FINDINGS,'malaria')]

IT DOES bring up records sets having malaria in Findings field.

BUT i do not want to do simple string matching, IS there a way of doing it by using namespaces or metadata on xml document..

ALL i want is to display a record that has malaria or a keyword matching in string of FINDINGS FIELD.

Hope that would be helpful in suggesting a solution...

Regards

Nomi



Unknowndiagnosis.xml
XML code

Postnext
Tony LavinioSubject: KEYWORD EXTRACTION FROM XML DOCUMENT
Author: Tony Lavinio
Date: 11 Sep 2007 08:27 AM
Namespaces are a way to group XML element names together.
I don't see how you would use them in searching.

And metadata is something stored outside of the document,
such as in an XML repository. Certainly you can use XQuery
to search for keywords there, but where _is_ 'there' for
you? Filesystems typically don't store any significant
metadata.

Postnext
Muhammad AkramSubject: KEYWORD EXTRACTION FROM XML DOCUMENT
Author: Muhammad Akram
Date: 23 Sep 2007 01:31 PM
HI
I understand as what you have explained,i have seen an example of doing what i need to do. Below is the example code and working...

<products>
<product><name>Water Corola</name>
<price>15<price>
</product >
<product>… </product> …
</products>
--------------------------------------------
This XMl file is associated to the following RDF description.

Catalog.xml#product1 lastUpdate “10/1/2005”.
Catalog.xml#product2 lastUpdate “10/2/1990”.
----------------------------------------------
To get products which lastupdate is before 1990, the query is as follows:

for $p in doc(“http://.../catalog.xml”) //product
metadata $p in
SELECT ?p
WHERE (?p lastUpdate ?u)
AND ?u < “1/1/1990”
return $p
------------------------------------

In this query, variable $p stores the product elements
of the document (line 1). The SPARQL query (lines
3 and 4) stores in variable ?p elements which last
update, stored in variable ?u, is before 1990. The
content of variable $p in the external XQuery query
is intersected with the content of the ?p variable in
internal SPARQL query, yielding the set of desired
products.
------------------------------------

I want to do something like this but i am not aware of how to create RDF using Stylus studio, or may be some other way.. and how to associate this RDF to XML file.. I could understand the query but will i be able to do it in stylus studio.. I tried to fid creating RDF in stylus studio, but did not find any help relating this..

Hope you could help me...

Regards,

Nomi

Posttop
Tony LavinioSubject: KEYWORD EXTRACTION FROM XML DOCUMENT
Author: Tony Lavinio
Date: 25 Sep 2007 08:18 AM
Stylus Studio does XSLT and XQuery, but not SPARQL.
And although you can use RDL:XML within the XML editor,
we don't support other serializations such as N3.

   
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.