Using attribute as a set of data and parsing this data

Hi everyone,
I present below a (little) challenge with the use of attributes in XQuery. Consider the following XML document:
<showroom>
<car id="1">
<name>Clio</name>
<family>Renault</family>
</car>
<car id="n">
<name>Q5</name>
<family>Audi</family>
</car>
</showroom>
Each client of the showroom is identified by a unique Id (e.g., 1,2,3,....). Then, i want to add some data to my XML document which should represent, for each car, the set of all clients' Id that have rented this car.
The desired XML document could look like this:
<showroom>
<car id="1">
<name>Clio</name>
<family>Renault</family>
+*<history>*+
+*<client id="2"/>*+
+*<client id="23"/>*+
+*</history>*+
</car>
<car id="n">
<name>Q5</name>
<family>Audi</family>
+*<history>*+
+*<client id="56"/>*+
+*</history>*+
</car>
</showroom>
However, by using elements in order to represent the rental historic, the document's size will increase significantly.
As i use only the clients' id, are there any way to represent the history data using only attributes ?+.
In the following document, the clients' id are represented, as a set, through the attribute +@history+:
<showroom>
<car id="1" history="2,23">
<name>Clio</name>
<family>Renault</family>
</car>
<car id="n" history="56">
<name>Q5</name>
<family>Audi</family>
</car>
</showroom>
However, are there any way to check if a given car of id='x' has been rented by a client of Id='y' ?+.
Does someone know how to represent the history data (sequence of clients' id), using only attributes, and how to look for a given client's id as explained above ?
Please suggest. I appreciate your help.

The two following documents represent examples of the showroom data and the clients' data respectively:
First document:
<showroom>
<car id="1">
<name>Clio</name>
<family>Renault</family>
</car>
<car id="n">
<name>Q5</name>
<family>Audi</family>
</car>
</showroom>
Second document:
<clients>
<client id="2">
<name>...</name>
<firstname>...</firstname>
<driverLicence serialNumber="2156311"/>
</client>
</clients>
The DTDs of these documents are defined as follows:
The showroom DTD:
<!ELEMENT showroom (car)*>
<!ELEMENT car (name,family)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT family (#PCDATA)>
<!ELEMENT N3 (#PCDATA)>
<!ATTLIST car id ID #REQUIRED>
The clients DTD:
<!ELEMENT clients (client)*>
<!ELEMENT client (name,firstname,driverLicence)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT driverLicence EMPTY>
<!ATTLIST client id ID #REQUIRED>
<!ATTLIST driverLicence serialNumber ID #REQUIRED>
Whenever a car is rented, I must add some information either in the same showroom document (it will be better for me) or in another document which relies rented car id with the id of the client which rented this car.
Thanks in advance for your help.

Similar Messages

  • How do I receive TCP data, and forward this data out a UDP socket?

    I can receive the TCP data and get it into an inputStream. I can also create the UDP socket-to send out a datagram packet.. I'm having a hard time getting the Input Stream data into a format acceptable for an UDP socket.

    I can receive the TCP data and get it into an
    inputStream. I can also create the UDP socket-to
    send out a datagram packet.. I'm having a hard time
    getting the Input Stream data into a format
    acceptable for an UDP socket.That's because you shouldn't and don't and won't be doing that.
    TCP is a stream protocol. UDP is a simpler protocol for sending packets. UDP is not suitable for use as a streamed protocol.
    If you want streams use TCP.

  • Using expdp to export a mix of tables with data and tables without data

    Hi,
    I would like to create a .dmp file using expdp, exporting a set of tables with data and another set without data. Is there a way to do this in a single .dmp file? For example, I want all the tables in a schema with data, but for the fact tables in that schema, I only want the fact table objects, not the data. I thought it might be easier to create two separate .dmp files, one for each scenario, but would be nice to have one .dmp file that satisfies my requirement. Any help is appreciated.
    Thanks,
    -Rodolfo
    Edited by: user6902559 on May 11, 2010 12:05 PM

    You could do this with where clauses. Let's say you have 10 tables to export, 5 with data and 5 without data. I would do it like this
    tab1_w_data
    tab2_w_data
    tab3_w_data
    tab4_w_data
    tab5_w_data
    tab1_wo_data
    tab2_wo_data
    tab3_wo_data
    tab4_wo_data
    tab5_wo_data
    I would make one generic query
    query="where rownum = 0"
    and I would make 5 specific queries
    query=tab1_w_data:"where rownum > 0"
    query=tab2_w_data:"where rownum > 0"
    query=tab3_w_data:"where rownum > 0"
    query=tab4_w_data:"where rownum > 0"
    query=tab5_w_data:"where rownum > 0"
    The first query will be applied to all tables that don't have their own specific query and it will export no rows, the next 5 will apply to each of the corresponding table.
    Dean

  • Planning attributes in 11.1.2.2 and start/end dates in a cell

    Hi. In Planning 11.1.2.2., can I make use of attribute dimensions as I would in a BSO Essbase cube?
    Also can I enter a start date and an end date entry in two different account members (e.g., start_date and end_date)?
    Thanks

    Hi,
    Yes, I believe you can use it.
    And you can change the Account member Data type as Date. Then use these Accounts in the Planning Web Form. Form will give you facility to select the Date...
    VB..

  • I just got a new iPhone and i set up iCloud on my girlfriend's account. To change it on settings it says delete account. Will this delete her all her data and back up data for iCloud on her iPhone and iPad?

    I just got a new iPhone and i set up iCloud on my girlfriend's account. To change it on settings it says delete account. Will this delete her all her data and back up data for iCloud on her iPhone and iPad? Can i change it without deleting it? Please help.

    Delete the account on your phone. This will not delete any data on her phone or iPad, or data stored in iCloud.

  • This disk doesn't contain an EFI system partition. If you want to start up your computer with this disk or include it in a RAID set, back up your data and partition this disk.

    As stated above. I get this when I try to resize my HD. Was having issues with BootCamp so I removed it and got this.
    This disk doesn’t contain an EFI system partition. If you want to start up your computer with this disk or include it in a RAID set, back up your data and partition this disk.

    the same problem...
    any help?

  • My ipad 2 won't rotate. i tried reseting it severally my "Use Side Switch" is set to Mute and there is no rotation lock sign close to the battery sign in the upper right side

    my ipad 2 won't rotate. i tried reseting it severally my "Use Side Switch" is set to Mute and there is no rotation lock sign close to the battery sign in the upper right side

    The software switch is in the task bar at the bottom. Double tap the home button and swipe to the right in the bottom of the screen. The speaker icon on the left would be where the software switch would be.
    If you don't see a lock icon in the upper right corner, the screen isn't locked, reboot your iPad.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • How to stop scheduled ship date and scheduled arrival date from defaulting to sysdate

    Hello,
    We have a business scenario where we are deriving scheduled ship date and scheduled arrival date outside and then imported in the instance with the order. However we find that the scheduled ship date and scheduled arrival date are defaulting to sysdate. The atp flag is set to N for these items. I have checked the defaulting rules, there is no such defaulting rule set for scheduled ship date or arrival date ( screenshot attached) Please share your thoughts on how can I stop scheduled ship date and arrival date date from defaulting to sysdate ?
    Thanks
    Rajesh

    Hi
    Please visit following link. It may be useful.
    How to prevent auto default of schedule ship date in sales order form
    HTH
    sd

  • Fixed start date and variable end date

    I'm using Project 2010 Standard. Task A has already started. It can't end until 2 weeks after the completion of task B. The only way I can make Project schedule this task is by doing so manually, allowing Project to calculate the duration. But then if the
    end date of task B changes, Project reschedules the entire task based on the duration without regard for the start date. If I add a % complete to task A, then the end date doesn't change if the end date of task B does. Project seems to fix the duration
    once it's calculated. I need the duration to be flexible based on the fixed start date and the end date of task B. This project file is stored in SharePoint so I can't make task A a hammock task. I get the error "You cannot create links from a project
    file that exists on a Web folder to another file" even though it's the same file. Any suggestions would be greatly appreciated.

    WhoKnows,
    I'm afraid without a hammock task the only way to do what you want is either with a manual reschedule or a macro to recalculate the duration of Task A when Task B moves.
    Update: Okay, after playing around here is a little trick that might work.
    1. Break Task A into two parts (e.g. -1 and -2)
    2. Set the predecessor of Task A-2 to be finish-to-start with Task A-1 and finish-to-finish + 2w with Task B
    Depending on the nature of Task A you may still need to do a little manual adjusting but it will effectively allow the start of Task A to be fixed and the finish to be variable depending on the status of Task B. Does that work for you?
    John

  • Planned order creation with PDS valid on only order start date and not finish date

    Hi All,
    We have requirement to allow creation of planned order manually if production version is valid on order start date and not finish date.  This is because lead time of order is longer. I refered OSS notes 385602. I could find out solution for this is implementation of OSS note 694140 to change validity mode at activity level to consider start date of first produce activity  in validity interval. Problem is even If I create order in APO by implementiong this note planned order is not transfered to ECC and it gets stuck with error production version not valid.
    Is there any way in ECC to control this? Any config or customization?
    Regards,
    Santosh

    Nilesh,
    I think there is a simple procedural skip happening in your business process. You are right when a planned order is created after MRP it would default assign it to the first available production version. 2options available for us,
    1. First use transaction MF50 and do the line loading and assign the quantites to the production versions/Production lines, so that the actual capacity planning is getting completed. This way you can have planned orders with both the production versions and matching to your actual line capacity.
    2. Use Quota arrangement concept, to automatically split the Planned orders during MRP for a percentage based on individual production versions.
    Now when backflush is performed S225 table is updated and Planned order qty also gets reduced.
    Hope this helps....
    Regards,
    Prasobh

  • Process Order Basic Finish Date and Scheduled Finish Date

    Folks,
    I have a requirement from the business to be able to update the Process Order Basic Finish Date and Scheduled Finish Date independently from each other.
    In other words, update the Basic Finish Date and the Scheduled Finish Date cannot change or update the Scheduled Finish Date and the Basic Finish Date cannot change.
    I believe the reason for this is to be able to use the Basic Date to maintain the ATP accurately and keep the Scheduled Date to mark when the order was originally due from the shop floor to be able to measure if orders are being completed on time or late.
    I have worked in tnx OPUZ and had some success with other issues with these dates but I can't seem to make them work independently from each other.
    Or does anyone have any ideas how to measure proces order performance to the production schedule?
    Thank you for your help,
    Greg

    Rajesha, thank you for your reply but it doesn't solve my problem.
    Let me restate my scenario:
    I start a process order and both the basic and scheduled finish dates are the same, June 1.
    At some point, shop floor tells me they will be late and cannot deliver until June 15.
    I need to update a date in the system so the ATP and the MRP planning runs have correct information for promising customers, I will update the Basic Finish date with June 15.
    I also need to keep the original June 1 date in order to measure the shop floor performance to the production schedule to measure how early or late the  order was delivered. How can I keep the original finish date or how can I measure if a process order is early or late??
    Thank you for your help,
    Greg

  • Difference between "Database Variant To Data" and "Variant To Data"

    Can anyone tell me the differnce between the 2 VI's "Database Variant To Data" and "Variant To Data"?
    I am using the database connectivity toolset and making a query.
    I have tried using both, but the give me the same result.
    Attachments:
    Variant to Data.JPG ‏45 KB

    You won't see a difference between these two functions with just a string or other simple data types.  Where you'll see a difference is with clusters and more complex data types that come from the database.  The variants returned by databases can be slightly different than the standard variant.  That is where the Database Variant To Data is needed.  Otherwise, if you are just reading string information, either function will work fine.
    Crystal

  • Basic Start Date and Schedule Start date

    Dear All,
    In a Preventive Maintenance order generated through IP30, I am getting Basic Start Date and Schedule Start date as different dates. For all other orders those date as coming same.   I am using forward Scheduling. Can any one of you please tell me what would be the problem?
    Regards,
    Babu R

    [SAP Note on Scheduling - Note 45433|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=45433]
    Regards,
    Maheswaran.

  • Java.sql.Date and java.util.Date - class loaded first in the classpath

    I had two jar files which has java.util.Date and java.sql.Date class file. i want to know whether which class is loaded first in the classpath...
    I like to change the order of loading the class at runtime...
    Is there is any way to change the order of loading of class...
    I may have different version of jar files for example xerces,xercesImpl. some of the code uses xerces ,some of the code uses xercesImpl..i had common classes.
    I like to load the class with the same name according to the order i need..
    Can we do all these in Run time ?????

    I had two jar files which has java.util.Date and
    java.sql.Date class file. i want to know whether
    which class is loaded first in the classpath...
    I like to change the order of loading the class at
    runtime...
    Is there is any way to change the order of loading of
    class...
    I may have different version of jar files for example
    xerces,xercesImpl. some of the code uses xerces ,some
    of the code uses xercesImpl..i had common classes.
    I like to load the class with the same name according
    to the order i need..
    Can we do all these in Run time ?????That is meaningless.
    The classes you are referring to are part of the Java API. Third party jars have no impact on that. And you can't change to the order because java.sql.Data is derived from java.util.Date. So the second must load before the first.
    And if you have two jar files with those classes in them (and not classes that use them) then you either should already know how to use them or you should stop trying to do whatever you are doing because it isn't going to work.

  • Java.util.Date and java.sql.Date

    when i am trying to displaying date in my jsp page errors occurs saying that java.util.date and java.sql.date are matching..
    i have some sql statements which i need to execute in the page.so i cant delete that import sql statement.
    so what is the solution for this.
    i want to display the date as 19th april 2003....in the jsp page.
    thank u

    You should use full names.
    java.util.Date date;
    java.sql.Date sdate;
    ..And it may be a good idea to delete one of the two "import" declaration of packages.

Maybe you are looking for