detail.php
OW2 Forge: Detail: 300546 Wildcard support

Advanced - Powered by Google


   
Log In
New Account
  
 
Home
My Page
Project Tree
Project Openings
XQuare
          
 
 
Summary
Forums
Tracker
Lists
Tasks
Docs
News
CVS
Files
SVN
                    
 

Tracker: Bugs

Submit New | Browse | Admin | ExportToXml

[ #300546 ] Wildcard support

Date:
2004-07-04 17:44
Priority:
5
Submitted By:
Alan Tam (at2000)
Assigned To:
Nobody (None)
Category:
bridge
State:
Open
Summary:
Wildcard support

Detailed description:
When we use the collection("table")/* XPath expression, the following exception is thrown. org.xquark.extractor.common.NotSupport: WildCard(*) in localName is not supported I suppose it would just need to use "SELECT table.* FROM table" in the SQL and let the driver tell you what fields have been selected. Two big use cases of this feature are: 1. renaming a table: <Rows> { for $Row in collection("Row")/OldRow return <NewRow>{$Row/*}</NewRow> } </Rows> 2. union 2 tables: <Rows> { for $Row in collection("Row1")/Row1 return <Row>{$Row/*}</Row> } { for $Row in collection("Row2")/Row2 return <Row>{$Row/*}</Row> } </Rows> 3. adding child nodes to a table: <Rows> { for $Row in collection("Row") return <Row> { $Row/* } { for $Child in collection("Child")/*[FK=$Row/PK] return <Child>{$Child/*}</Child> } </Row> } </Rows> Do you think there is solution to either of these use cases without listing all fields of the table(s) in the XQuery code? On the other hand, could it be easy enough to be implemented soon? Thanks in advance!

Add A Comment:

Please login

Followup

Message
Date: 2004-07-05 14:58
Sender: amensch
Logged In: YES 
user_id=737

Unfortunately, it's not so easy: supporting this construct 
requires supporting unions (Table/* is not equivalent to 
select * from Table, but rather equivalent to select C1 
from Table union select C2 from Table union ... and union 
is definitely not easy.
There is no easy workaround: one is to keep an external tag 
in the returned values and remove it later in the 
processing (using a SAX Filter or XSL-T).

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
resolution_idNone2004-07-05 14:58amensch

Copyright © 1999-2008, OW2 Consortium | contact | You have a difficulty, a problem ? Please report an issue using your OW2 forge account credentials