How to sort an xml Based on "property name or node"

Input
'<Email>
  <Type>Personal</Type>
  <Code>1</Code>
  <Description>[email protected]</Description>
  <LocalId>000000000000000000000000868000000001</LocalId>  
</Email>'
OUPUT
'<Email>  
  <Code>1</Code>
  <Description>[email protected]</Description>
  <LocalId>000000000000000000000000868000000001</LocalId>  
  <Type>Personal</Type>
</Email>'
how do this using sql ? 

DECLARE @xml as xml
SET @xml ='<Email>
  <Type>Personal</Type>
  <Code>1</Code>
  <Description>[email protected]</Description>
  <LocalId>000000000000000000000000868000000001</LocalId>  
    <Infeliz>
<Za>
Fuck
</Za>
<Maria>
Fuck
</Maria>
  </Infeliz>
</Email>'
SELECT '<Email>' 
+ CONVERT(varchar(1000), @xml.query('for $x in (/Email/*) 
  order by local-name($x) 
                   return $x '))  
       + '</Email>'
OUPUT - NOT OK 
<?xml version="1.0" encoding="UTF-8"?>
<Email>
<Code>1</Code>
<Description>[email protected]</Description>
<Infeliz>
<Za>Fuck</Za>
<Maria>Fuck</Maria>
</Infeliz>
<LocalId>000000000000000000000000868000000001</LocalId>
<Type>Personal</Type>
</Email>
I want so
<?xml version="1.0" encoding="UTF-8"?>
<Email>
<Code>1</Code>
<Description>[email protected]</Description>
<Infeliz>
<Maria>Fuck</Maria>
<Za>Fuck</Za>
</Infeliz>
<LocalId>000000000000000000000000868000000001</LocalId>
<Type>Personal</Type>
</Email>

Similar Messages

  • How to get BP kind based on user name?

    Hi,
    How to get BP kind based on user name?
    Is there any table other than BUT000 which gives the Business partner no. and BP KIND?
    What is BLUEPRINT table?

    Hi John,
    do you mean Type:
    1     Person
    2     Organisation
    3     Group
    or Role like
    000000     Business Partner (General)
    BBP000     Vendor
    BBP001     Bidder
    BBP002     Portal Provider
    BBP003     Plant
    BBP004     Purchasing Company
    BEA001     Billing Unit
    BUP001     Contact Person
    BUP002     Prospect
    BUP003     Employee
    BUP004     Organizational Unit
    BUP005     Internet User
    The Role can be found in BUT100.
    Regards
    Gregor

  • How to sort a collection based on their date?

    how do i sort a collection based on their respective dates which are in Calendar format?

    this is my codes
    /** This class is use to sort the call list base on their date
    import java.util.*;
    public class a implements Comparator
         /** compare the objects base on their types
         *     @obj1 the first object to be compared
         *     @obj2 the second object to compare with the first object
         public int compare(Object obj1, Object obj2)
         if (obj1 == obj2)
              return 0;
         if (obj1 == null || obj2 == null)
              return 0;
         if (!(obj1 instanceof Call) || !(obj2 instanceof Call))
              return 0;
         Call lhs = (Call) obj1;
         Call rhs = (Call) obj2;
         int s = lhs.getDate().compareTo(rhs.getDate());
         if (s != 0)     
              return s;
         return 1;
    this is the error
    a.java:21: cannot resolve symbol
    symbol : method compareTo (java.util.Calendar)
    location: class java.util.Calendar
         int s = lhs.getDate().compareTo(rhs.getDate());

  • How to use/access XML based DVMs in ODI 11.1.1.5.0

    Hi All,
    I want to use XML based DVMs in interface on ODI 11.1.1.5.0.
    I have tried something like this. However while "Load Data" step, i am facing the error "
    -4850 : 3F000 : java.sql.SQLException: invalid schema name: CURRENCYCODE
    java.sql.SQLException: invalid schema name: CURRENCYCODE
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
    at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.prepareStatement(SnpsXmlConnection.java:1192)
    at sun.reflect.GeneratedMethodAccessor314.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.odi.core.datasource.dwgobject.support.OnConnectOnDisconnectDataSourceAdapter$OnDisconnectCommandExecutionHandler.invoke(OnConnectOnDisconnectDataSourceAdapter.java:200)
    at $Proxy138.prepareStatement(Unknown Source)
    at oracle.odi.runtime.agent.execution.sql.SQLCommand.doInitializeStatement(SQLCommand.java:83)
    at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:117)
    at oracle.odi.runtime.agent.execution.sql.SQLCommand.getStatement(SQLCommand.java:111)
    at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:76)
    at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
    at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:67)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1595)
    at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$2.doAction(StartScenRequestProcessor.java:580)
    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
    at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor.doProcessStartScenTask(StartScenRequestProcessor.java:513)
    at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$StartScenTask.doExecute(StartScenRequestProcessor.java:1070)
    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
    at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: org.hsqldb.HsqlException: invalid schema name: CURRENCYCODE
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.SchemaManager.getSchemaHsqlName(Unknown Source)
    at org.hsqldb.SchemaManager.getSchemaName(Unknown Source)
    at org.hsqldb.Session.getSchemaName(Unknown Source)
    at org.hsqldb.SchemaManager.getTable(Unknown Source)
    at org.hsqldb.ParserDQL.readTableName(Unknown Source)
    at org.hsqldb.ParserDQL.readTableOrSubquery(Unknown Source)
    at org.hsqldb.ParserDQL.XreadTableReference(Unknown Source)
    at org.hsqldb.ParserDQL.XreadFromClause(Unknown Source)
    at org.hsqldb.ParserDQL.XreadTableExpression(Unknown Source)
    at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
    at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source)
    at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source)
    at org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source)
    at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source)
    at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source)
    at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source)
    at org.hsqldb.ParserCommand.compilePart(Unknown Source)
    at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
    at org.hsqldb.Session.compileStatement(Unknown Source)
    at org.hsqldb.StatementManager.compile(Unknown Source)
    at org.hsqldb.Session.execute(Unknown Source)
    ... 27 more"
    Steps followed:
    1. Created data server with below values.
         JDBS Driver : com.sunopsis.jdbc.driver.xml.SnpsXmlDriver
         JDBC URL : jdbc:snps:xml?f=/appl/oracle/dev/fmw/11g/product/Oracle_ODI1/oracledi/xml_odi/CURRENCY95CODE.xml&s=CURRENCYCODE&case_sens=true
    2. Created a physical schemas out of it and passed SCHEMA as "CURRENCYCODE". Please note that it dint showup automatically. I had to type the schema name "CURRENCYCODE".
    3. Implemented logic in interface and facing the above error when tried executing interface at "Load Data" step.
    Note : Test Connection is working fine. And i have all the permissions to execute.
    Kindly suggest the right way if i am doing something wrong.

    Hello,
    Your filemaker install should have come with a jdbc driver (.jar file). You'll need to check your filemaker pro documentation to confirm. Once you have the file, place it in the ODI/oracledi/agent/drivers folder where your agent lives (also place it on your client if you want to use the local agent for testing). You can then create a custom Technology in the Topology tab in ODI.
    There are many options in the Technology definition which you will need to figure out based on what filemaker pro can handle and how it processes queries. Once the technology is created, add a Data Server and Physical Schema as you would any other technology. Then, build the model, datastores, interfaces, etc. just like any other tech.
    Hope this gets you started.
    Thank you,
    Michael R.

  • How to sort a sortingTable based on a particular column available in it?

    Hi,
    I am using the sortingTable as follows:
    <Field name='WorkItemTable'>
    <Display class='SortingTable'>
    <Property name='linkEnable' value='true'/>
    <Property name='sortEnable' value='true'/>
    <Property name='columns'>
    <List>
    <String>PROCESS</String>
    <String>DESCRIPTION</String>
    <String>DATE</String>
    </List>
    </Property>
    </Display>
    I need to sort the table's value with respect to 'Date' column available in the sorting table.
    I have used the following property tag under sortingTable.
    <property name='sortEnable' value='true'/>
    But i need to point this sorting functionality to date column..
    Can someone help me to get the solution... Thanks in advance..
    Regards,
    babu

    Hi,
    I am using IdM 7.1 and I observed that default sorting table used by idm for e.g at server task page, doesn't sort on date basis.
    ~Ketan

  • How to create a record based on the name of a file in the file-system?

    Hi,
    With a lot of pictures I want to have a database to gather some information about these pictures.
    First question is how to generate a record based on a file in the file system?
    e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
    now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
    any suggestions?
    any reaction will be appreciated.
    Leo

    Link to Create directory
    http://www.adp-gmbh.ch/ora/sql/create_directory.html
    You can create a list of files in the directory and read the list files from that directory.
    [UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
    [Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
    SS

  • ADF Faces - how to sort a column by sub-property ?

    hi,
    in a "af:table", this works fine :
    <af:column sortProperty="title" sortable="true">
    <f:facet name="header">
    <af:outputText value="Titre" />
    </f:facet>
    <af:outputText value="#{thisRowDoc.title}" />
    </af:column>
    but this doesn't :
    <af:column sortProperty="facility.libelle" sortable="true">
    <f:facet name="header">
    <af:outputText value="Service" />
    </f:facet>
    <af:outputText value="#{thisRowDoc.facility.libelle}" />
    </af:column>
    how can i sort on a property of a property ?
    thx !

    Hi,
    you have to consider that when loading a tile for the first time always rowloaded2 is fired (several times) and afterwards onload. Maybe rowloaded2 again afterwards. So it should work to sort in onload.
    But when clicking the <back> button in the menue the order of the fired events might be different!
    Do you want to sort by an unbound column which is readonly or is it also editable (see other thread)? In this case things might be much more complicate... Normally another sorting should be done in onsave event but unfortunately you don't save anything as it is unbound...
    Regards,
    Wolfhard

  • How to specify a collection-based TFS group name in process template XML

    I'm trying to modify a work item template so that only members of a certain group can modify it. I have the following:     
    <FIELD name="State" refname="System.State" type="String" reportable="dimension">
    <HELPTEXT>The workflow state of the requirement</HELPTEXT>
    <READONLY not="[project]\Requirements Editors" />
    </FIELD>
    However, I want to be able to add this group globally, or at the very least to a collection instead of a project. The questions I have are:
    I know how to add a new group to a collection (as opposed to a project), but how do I change the XML syntax to see it? I know I can use the prefix [project] to check the current project, but how can I do the same generic thing for a collection instead of
    having to name it here? I have tried [Collection] but that doesn't seem to work.
    Is there some way to make this global? That is, I don't want to have to add this group to each collection, so is there a way to make it accessible by all collections/projects? If so, what is the XML syntax I need, and how do I add the group?
    Even with the basic [project] syntax, and adding the group to a particular project I still can't seem to update the template as I get the following error: "TF212017: Work item tracking schema validation warning: TF26171: User/group '2f0bf5ee-d0f9-4441-b8ad-cbd38b00c407\WHSCC
    Requirements Editors' is not found." What am I doing wrong here?
    Thanks!

    Hi Chris,  
    Thanks for your post.
    For collection group in work item template, we should write like this: [Global]\collectiongroupname.
    The [project] mean current team project, so you need ensure you have created that Requirements Editors group in your current team project, then edit the work item type in current team project.
    And I suggest you install the TFS Power Tools, then edit work item type using VS>>TOOLS>>Process Editor. 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Determine Task Key based on Task Name?

    Hi all, I'm trying to implement addProcessTaskInstance and I can't seem to dynamically obtain the task key. I want to find this based on the task name since this will be consistent through environments, but due to multiple development streams going on at once I can't be guaranteed that the task key will be the same in each in environment (i can be guaranteed it won't be actually). I'd rather not hard code the key in a variable in each environment if I can avoid it.
    Thanks,
    Ryan

    Hi Ryan,
    you could also use api to retrieve the task key.
              HashMap map = new HashMap();
              map.put("Process Definition.Tasks.Task Name", your_task_name);
              tcResultSet localtcResultSet = tcUtilityFactory.getUtility(tcDataProvider, "Thor.API.Operations.TaskDefinitionOperationsIntf").getTaskDetail(your_form_key, map);
              taskKey= localtcResultSet.getLongValue("Process Definition.Tasks.Key");
    This would be slower than database query though.
    Regards,
    Ece

  • How can I pass value based on member names in a script in 11.1.1.3

    I want to pass a value to only those members of CostCenter dimension which has "5" in their name.
    Eg.
    C12345100
    C34565210
    C34217890
    So in the above case the value should exist only in the above 2 cost centers.
    Can someone guide me in the right direction to accomplish this ?
    Thanks in advance

    Just now I got more clearance on the requirement.
    I want to create blocks only on the selected Cost Centers & Business Unit combination.
    I have the following members in both these dimensions
    Cost Centers
    C12345980
    C12345981
    C12345982
    Business Unit
    BU5980
    BU5981
    BU5555
    Now I want to pass a value to one of the dense dimension members from Measure dimension (member name = CrtBlk) to only those CCs & BUs where the last 4 digit matches.
    So in this case it will be for only the first 2 cost centers.
    Thanks in advance.

  • How to get the xml element and comment name in a page?

    I need to list all element and comment name in a page

    Hi,
    do
      //K2Vector<XMLReference> allXMLRefs;
                        std::vector<XMLReference> allXMLRefs;
      IActiveContext* context = GetExecutionContextSession()->GetActiveContext();
                        UIDRef documentUIDRef = ::GetUIDRef(context->GetContextDocument());
                        XMLReference rootXMLRef = GetRootXMLReference(documentUIDRef);
                        GetFlattenedElementList(documentUIDRef,allXMLRefs);
                        std::ostringstream os;
                        for(std::vector<XMLReference>::iterator it = allXMLRefs.begin(); it != allXMLRefs.end(); ++it)
                                  XMLReference nextref = *it;
                                  PMString tag_name;
                                  os.str("");
                                  os <<  AsString(nextref,tag_name).GetPlatformString().c_str();
      CAlert::WarningAlert(os.str().c_str());
              }while(kFalse);
    I use above code to get tag name.
    Any one help me to get the comment tag in XML

  • Creating a new cell factory, how to bind to my object's property

    As near as I can tell, the javafx binding using observable values, alot like jgoodies and its not like SWT databinding or WPF binding.
    I was creating a cell factory for a TreeView. Just using a label to display the contents and calling toString, alot like the way it works now. However, I could not figure out to create a binding that would bind to a property on my domain object. Is there a way to specify the binding to the Label's text property so that whatever object that the cell's item's value has I can bind to a property that I specify on it e.g. the "name" property. But I could not see how to do that. Also, the only way I could figure out how to update the Label's value was from updateItem. I thought maybe I could even setup the binding in updateItem so that when the TreeItem's value changed at least it would automatically update the label binding, but the API did not seem to support that.
    What's the right coding pattern to use when using straight Java coding?
    I know in jgoodies I could do this using the PresentationModel approach or master-detail SWT or WPF with just specifying the property on the item's property that I want in WPF.
    public static class MyTreeCell extends TreeCell<Object> {
              Label label;
              public MyTreeCell() {
                   label = new Label();
                   setNode(label);
              @Override
              public void updateItem(TreeItem<Object> arg0, boolean arg1) {
                   if (arg0 != null && arg0.getValue() != null) {
                        System.out.println("New value: " + arg0.getValue());
                        label.setText(arg0.getValue().toString());
                   } else {
                        System.out.println("New value is null and this println is called alot, why is that?");
                   super.updateItem(arg0, arg1);
         }

    Well the presentation model thing worked fine and I have some machinery for the cell factory/cell item to obtain a tree cell based on the domain object type (a template/factory is placed into the properties in the scenegraph hierarchy). But its not smooth yet and the pattern does not quite translate well into javafx. Because the cell factory produces cells that could be used for a variety of domain object types, all the logic gets pushed down to the treecell subclass which makes it messy. Maybe this is where CSS selectors need to come in, you specify the class of a tree cell for a specific domain object type and you can set that at the root of the application so it cascades. I'll see if this approach works.
    Here's the code for the javafx version of jgoodies' presentation model, less the corner cases. This allows you to bind to a property and change the bean underneath that the property accesses. I'm not convinced that having properties has observable values directly on the objects is the right model for javafx because of the coupling to the actual object the property represents. Sometimes, you need to represent the property concept separate from the actual object instance. Maybe this already exists in the library.
          * An object binding object that creates object bindings based on property
          * names specified as strings. This is a convenience class. Generally, the
          * return values from <code>getProperty()</code> should be used for binding
          * not the factory itself. The object should be a domain object bean with
          * bean methods to get or set the value using java bean naming conventions.
          * When the bean itself changes, the properties fire to indicate that their
          * values may have changed and the observing object should update itself.
          * <p>
          * This only handles reading bean properties. Need to add set() logic.
          * <p>
          * TODO: Make this work better. Many corner cases to cover. Include PCL.
         public static class BeanBindingFactory<T> extends ObjectBinding<T> {
              T bean;
              Map<String, CaptiveObjectProperty> properties = new HashMap<String, CaptiveObjectProperty>();
              public Property getProperty(String property) {
                   if (property == null || property.isEmpty())
                        throw new IllegalArgumentException("Property cannot be null");
                   if (properties.containsKey(property))
                        return properties.get(property);
                   CaptiveObjectProperty p = new CaptiveObjectProperty(this, property);
                   properties.put(property, p);
                   return p;
              public void setBean(T bean) {
                   this.bean = bean;
                   for (CaptiveObjectProperty p : properties.values()) {
                        p.invalidate();
                   fireValueChangedEvent();
              public T getBean() {
                   return bean;
              @Override
              protected T computeValue() {
                   return bean;
               * Lazily get the method representing the property.
               * @author Mr. Java
               * @param <T>
              protected static class CaptiveObjectProperty<T> extends
                        ObjectPropertyBase<T> {
                   String property;
                   Method m;
                   BeanBindingFactory factory;
                   public CaptiveObjectProperty(BeanBindingFactory factory,
                             String property) {
                        this.property = property;
                        this.factory = factory;
                   @Override
                   public Object getBean() {
                        if (factory == null || factory.getBean() == null)
                             return null;
                        return factory.getBean();
                   @Override
                   public T getValue() {
                        if (m == null) {
                             m = getMethod();
                        if (m == null)
                             return null;
                        try {
                             Object rval = m.invoke(factory.getBean());
                             return (T) rval;
                        } catch (Exception e) {
                             e.printStackTrace();
                        return null;
                   @Override
                   public String getName() {
                        return property;
                    * Invalidate the method. Perhaps the bean changed to another object
                    * and we should find the method on the new object.
                   public void invalidate() {
                        m = null;
                        fireValueChangedEvent();
                   protected Method getMethod() {
                        if (factory == null || factory.getBean() == null)
                             return null;
                        String methodName = "get"
                                  + Character.toUpperCase(getName().charAt(0));
                        if (getName().length() > 1)
                             methodName += getName().substring(1);
                        try {
                             Method mtmp = factory.getBean().getClass()
                                       .getMethod(methodName, new Class<?>[0]);
                             return mtmp;
                        } catch (Exception e) {
                             e.printStackTrace();
                        return null;
         }

  • How to sort Data in XML template (rtf) file?

    Hi, I have an oracle 11i custom report (rdf) with an xml output to a PDF. There is a formula column in the report. Now I need the data to be sorted on this formula column. As we cannot sort on formula column, i have decided to find a way to sort it in the data in the XML template. But I don't really know how to sort and also where to specify the sort tag in the rtf file. I appreciate your response.
    Databse version : 9.2.0.8.0
    E-Biz Version : 11.5.10.2
    Oracle Reports Version : 6.0.8.27.0
    Oracle BI version : 10.1.3.2.1
    Note : I posted this question under : XML General forum also. But did not get any response. I assumed that may be thats not the right place to post it as my report is in e-Biz environment.

    Hi
    As long as you don't have your ^field commands grouped inside a ^group the order in the .dat file is not important. Your last command
    ^field BG_DOC_LN__LN_AM
    246624.12
    should populate field BG_DOC_LN_AM wherever you place it on your form. Obviously you need to name the fields according to your ^field commands and not just use tab (move to next field).
    Shout if this was not what you are asking.
    Stale Sodal

  • How to use XmlModify to sort the XML Data?

    Hello,
    I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
    <CustomerData>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>002</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>102</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    // many nodes like transaction ...
    </CustomerData>
    My XQuery script was executed successfully in the shell. The script looks as follows:
    "for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
    The Java code :
    // create XmlManager
    XmlManager manager = // ...;
    // open XmlContainer
    XmlContainer container = // ...;
    XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
    XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
    XmlModify modify = manager.createModify();
    XmlUpdateContext uc = manager.createUpdateContext();
    XmlDocument xmldoc = container.getDocument("sample.xml");
    XmlValue value = new XmlValue(xmldoc);
    long numMod = modify.execute(value, context, uc);
    System.out.println("Peformed " + numMod     + " modification operations");
    Could you point out the errors above or offer some suggestion?
    Thanks.

    I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
    1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
    2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
    The export method:
    public void export(String outputfile)throws Exception{
    final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
    try{
    File theFile = new File(outputfile);
    FileOutputStream fos = new FileOutputStream(theFile);
    byte[] buff= new byte[BLOCK_SIZE];                         
    XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());               
    while(rs.hasNext()){
         XmlDocument xmlDoc = rs.next().asDocument();
         XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();                    
         long read=0;
         while(true){
         read = inputStream.readBytes(buff, BLOCK_SIZE);
    fos.write(buff,0,(int)read);                    
         if(read < BLOCK_SIZE) break;
    inputStream.delete();
    xmlDoc.delete();
    rs.delete();
    //MUST CLOSE!
    fos.close();               
    catch(Exception e){
    System.err.println("Error exporting file from container " + container);
    System.err.println(" Message: " + e.getMessage());
    Thanks.

  • How to set dynamic color , based on xml element

    Hi,
    We have a requirement, where based on certain conditions, a cell will be shown in a specific color. We would like the coloir to be based on an XML element. The xml element will have values like '#FF00FF' etc..
    We tried using xsl attribute with the following syntax ,
    <xsl:attribute xdofo:ctx="block"name="color"><?stdcolor?></xsl:attribute><?end if?>
    where stdcolor is the xml element, but when we use this , this is giving a syntax error.
    Let us know, if this is possible or is there any other alternate way to do this.
    Regards,
    - Vasu -

    Hi Vasu,
    http://winrichman.blogspot.com/2008/09/how-to-set-dynamic-color-based-on-xml.html
    use the following :)
    <xsl:attribute xdofo:ctx="block" name="color" ><xsl:value-of select="stdcolor" /></xsl:attribute>
    TO get the colors you wanted , you can refer to
    http://www.w3schools.com/Html/html_colors.asp

Maybe you are looking for

  • How to use Flat files as targets

    The root path of location LOC_FLAT_TGT must be specified as one of the file paths for the UTL_FILE_DIR parameter in the init.ora for the runtime instance. The root path of location LOC_FLAT_TGT must be a file path on the server. Thanks in Advance, Ja

  • Java mail api: SendFailedException when trying to send Mail via SMTP

    Hello, I'm trying to send a mail via java mail api using a server that requires smtp authentication. I'm currently using the following code: protocol = "smtp"; host = "auth.smtp.profimailer.de"; port = 25; String from="[email protected]"; String to="

  • Unable to access AirPort Disk

    I have a 250GB WD Mybook hooked up via USB to my AEBS (Running 7.2.1). I see the name of my base station in the Finder under SHARED but if I double click on it I simply see "Connecting..." at the top of the window and it goes nowhere. If I click on C

  • Getting standerd size of the screen

    in java 2d there two spaces one is user another system java says there is two spaces 1.user space is system independent 2.system space so i want know is there any standerd screen size is there where in which i can design my gui by doing that when i r

  • Zen Vision M 30G will not connect to

    New at this, please bear with me. My player worked just fine, unfortunately I don't have a car charger and after a long trip killed the battery. I return home, plug the player into my computer and nothing happens. I get frustrated, try everything, ev