Concat expression Collection T

Hi all,
I have a mapping in my entity, one to many mapping, example relationship "1 question -> many answers"
so, in Question class, i can access a collection of "Answers"; But in my criteria query, i need to concat all "Answers' summary" for sorting purpose. ("summary" is a field in Answer class)
I can get:
  Expression<Collection<T>> e = root.get("answers") but i don't know how to create sorting criteria for concatenation of all summary that an answer has.
I have googled around, but i haven't found a way to do it.
thank you for your help
regards,
-Hoang Long
Edited by: CardM on Aug 7, 2012 7:34 PM

Hi all,
I have a mapping in my entity, one to many mapping, example relationship "1 question -> many answers"
so, in Question class, i can access a collection of "Answers"; But in my criteria query, i need to concat all "Answers' summary" for sorting purpose. ("summary" is a field in Answer class)
I can get:
  Expression<Collection<T>> e = root.get("answers") but i don't know how to create sorting criteria for concatenation of all summary that an answer has.
I have googled around, but i haven't found a way to do it.
thank you for your help
regards,
-Hoang Long
Edited by: CardM on Aug 7, 2012 7:34 PM

Similar Messages

  • PeopleCode :: Query API :: Query Expression collection problems

    Hi all,
    I'm trying to use the Query API in PeopleCode to tack on an expression to the end of an existing query. Thus far I have been successful doing just a QueryField without any problems. Here is some example code of what I have done with the Query Expression collection and where I am stuck:
    &Criteria = &MainQrySel.AddCriteria("criteria1");
    &Criteria.Logical = %Query_CombAnd;
    &Criteria.Expr1Type = %Query_Expression;
    &crit = &Criteria.AddExpr1Expression();
    &Criteria.Expr1Expression = &crit;
    &crit.Text = -some expression-;
    &Criteria.Operator = %Query_CondEqual;
    &Criteria.Expr2Type = %Query_ExprConstant;
    &crit = &Criteria.AddExpr2Expression();
    &Criteria.Expr2Expression1 = &crit;
    &crit.Text = -some criteria-;
    So what's happening is that the left hand part of the expression is added to the entire statement along with the operator (the equals sign). The odd part is that the right hand part of the expression is not (basically the -some criteria- part).
    If anyone has any ideas on how to solve this mystery, please let me know...I'm rather confuzzled!
    Thanks in advance!

    Well, I finally discovered he solution on my own, by reverse-engineering Oracle's own search.jsp (which does not use Oracle's custom tag library, btw) (probably because same doesn't really work, or at least it doesn't what's in the documentation doesn't work) (which isn't surprising).
    You have to do the "From" part of the query as an "attribute filter".
    oracle.ultrasearch.query.Query searchQuery=
    new oracle.ultrasearch.query.Contains(searchString, metadata);
    oracle.ultrasearch.query.Query attrQuery=
    new oracle.ultrasearch.query.From(metadata.getGroup(groupToSearch));
    oracle.ultrasearch.query.Request searchRequest=new oracle.ultrasearch.query.Request();
    searchRequest.setQuery(searchQuery);
    searchRequest.setFilter (attrQuery);
    Maybe that will do somebody some good somewhere...
    Troy

  • What is the cause of the XPath error in concat expression

    Hi,
    In a BPEL process I am working on I am building a list as follows -
    <copy>
    <from expression="concat(bpws:getVariableData('FMSNumbersList'),' | ',bpws:getVariableData('Invoke_1_GetFmsHeadersSelect_OutputVariable','FmsWaveAssignCollection','/ns5:FmsWaveAssignCollection/ns5:FmsWaveAssign/ns5:fmsHeadersCollection/ns5:FmsHeaders[bpws:getVariableData('FmsHeadersProcessed')]/ns5:fmsNumber'))"/>
    <to variable="FMSNumbersList"/>
    </copy>
    When I compile the project I get the following error -
    Error(195): invalid xpath expression
    xpath expression "concat(bpws:getVariableData(&apos;FMSNumbersList&apos;),&apos; | &apos;,bpws:getVariableData(&apos;Invoke_1_GetFmsHeadersSelect_OutputVariable&apos;,&apos;FmsWaveAssignCollection&apos;,&apos;/ns5:FmsWaveAssignCollection/ns5:FmsWaveAssign/ns5:fmsHeadersCollection/ns5:FmsHeaders[bpws:getVariableData(&apos;FmsHeadersProcessed&apos;)]/ns5:fmsNumber&apos;))" specified in <from> is not valid, because XPath query syntax error.
    The syntax error occurs while parsing XPath expression concat(bpws:getVariableData('FMSNumbersList'),' | ',bpws:getVariableData('Invoke_1_GetFmsHeadersSelect_OutputVariable','FmsWaveAssignCollection','/ns5:FmsWaveAssignCollection/ns5:FmsWaveAssign/ns5:fmsHeadersCollection/ns5:FmsHeaders[bpws:getVariableData('FmsHeadersProcessed')]/ns5:fmsNumber')), at position 255.
    The XPath query syntax was wrong; the exception was: Expected: ).
    Check the detailed root cause described in the exception message text and verify that the XPath expression named in the error message is correct. The XPath expression is defined in the BPEL process.
    Make sure the expression is valid
    I am unable to figure out what is wrong with the above expression. Can someone please help.
    Thanks in advance
    Harish

    You have to use two copy statement to fetch values like an Array.
    1. Construct a dynamic xpath expression
    2. Use dynmaic xpath to get the array value
    Eg:
    The below code shows how to use assign to build the dynamic XPath.
    <assign name="Assign_XPath_For_Array">
    <copy>
    <from expression="concat('/ns1:ArrayList/ns2:ArrayElem[',bpws:getVariableData('Variable_Index_Counter'),']') "/>
    <to variable="Variable_Xpath"/>
    </copy>
    </assing>
    Note have used [index] to represent index element here in the array.
    Here Variable_Xpath acts as a temporary string variable that holds the intermediate Xpath as string.
    Now use this XPath string Variable while reading array index elements.
    This would look like
    <assign name="Assign_Read_Array">
    <copy>
    <from expression="bpws:getVariableData('Variable_Array','payload',bpws:getVariableData('Variable_Xpath'))"/>
    <to variable="Variable_Read_Array_Element"
    query="/ns1: ABC"/>
    </copy>
    </assign>
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Looping through Collection

    Hello I need to loop through the collection to process 500 records at a time from the resultset.
    how do i do this?
    I have created another variable of same type as resultset output variable type. but not sure how to assign nodes 1 to 1000 to the new variable.

    Hi,
    You can loop over your collection with a while loop. The following is from the bpel samples directory (112.Arrays) adapted to your needs. Define the variables:
    <variable name="iterator" type="xsd:integer"/>
    <variable name="count" type="xsd:integer"/>
    <variable name="xpath" type="xsd:string"/>
    Set the initial values:
    <assign name="SetInitialValues">
    <copy>
    <from expression="1"/>
    <to variable="iterator"/>
    </copy>
    <copy>
    <from expression="ora:countNodes('input', 'payload','/tns:collection/tns:item')"/>
    <to variable="count"/>
    </copy>
    </assign>
    Make a while loop:
    <while condition=" bpws:getVariableData('count') >= bpws:getVariableData('iterator')">
    <sequence>
    <assign name="setAttribute">
    <copy>
    <from expression="concat('/tns:collection/tns:item[',bpws:getVariableData('iterator'),']/tns:value')"/>
    <to variable="xpath"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('input','payload',bpws:getVariableData('xpath'))/>
    <to variable="output" part="payload" query="/tns:recordVariable/tns:value"/>
    </copy>
    <!--
    Place here your own actions to be executed for every row
    -->
    <copy>
    <from expression="bpws:getVariableData('iterator') + 1"/>
    <to variable="iterator"/>
    </copy>
    </assign>
    </sequence>
    </while>
    So the trick is to dynamically build an xpath expression based on the while loop counter.
    Kind Regards,
    Andre

  • Expression and "end with"

    Hi,
    Using expression, i'm trying to build an expression that use a field as a like criteria. It a kind of reverse "like" SQL function. I have entity "reference" with à refcode field and some record that look like :
    Id refcode
    1 123
    2 BLA
    3 BLA1
    I would like to get one of this record depending request arguement that I call "code". It look like that :
    If I want record that match the begin of the "code" BLA1TEST1, it will return entity Id 2 and 3. So It look like :
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression e1 = eb.get("refcode").concat('%')
    Expression expr = eb.getParameter("code").like(e1)
    Query query.addArguement("BLA1TEST1");
    And it work.
    If I want record that match "contain" of the "code" ESSBLA123", it will return entity Id 1 and 2 and 3. And it look like :
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression e1 = eb.get("refcode")
    Expression expr = eb.getParameter("code").containsSubstring(e1)
    Query query.addArguement("ESSBLA123");
    work too.
    But if I want record that match the end of the "code" BL123, that may return entity Id 1, I don't kown howto ?
    Thanks for your help.
    Note : I get the result with JPQL like this :
    For begin with :
    String asql = String.format ("SELECT a.id FROM Reference a WHERE '%s' LIKE concat(a.refCode,'%%')", code);
    Query sq = em.createQuery (asql, Reference.class);
    For end with :
    String asql = String.format ("SELECT a.id FROM Reference a WHERE '%s' LIKE concat('%%', a.refCode)", code);
    For contain :
    String asql = String.format ("SELECT a.id FROM Reference a WHERE '%s' LIKE concat('%%', a.refCode, '%%')", code);
    Edited by: user11112980 on 6 oct. 2011 03:44
    Edited by: user11112980 on 6 oct. 2011 04:57

    Hello,
    I assume the problem is with creating an expression equivalent to "SELECT a.id FROM Reference a WHERE '%s' LIKE concat('%%', a.refCode)"? If so you can use a literal:
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression e1 = eb.literal('%').concat(eb.get("refcode"));
    Expression expr = eb.getParameter("code").like(e1)
    Query query.addArguement("BL123");
    Or it might be more accurate to use a constant:
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression e1 = (new ConstantExpression('%', eb)).concat(eb.get("refcode"));
    Best Regards,
    Chris

  • Express suddenly stopped extending network?

    My Airport Express was extending my network to the basement (and using airplay to a stereo) from my Airport Extreme network. Lately it stopped working. Although the AP utility says it was connected and had excellent signal, the "info" button said it was unable to extend the network check all the settings blah blah.I did of course however no settings actually changed. I did a reset, moved into the same room as the main airport and it will see the express, collect information, and try to join then says an error occurred please try again? Any advice is most appreciated.

    http://support.apple.com/kb/HT4260
    This should help you.

  • Unable to bring up expression editor for Assign component 's source node

    Hi All,
    I am a beginner in BPEL and trying to create a simple hello world BPEL process in my JDev 11.1.1.5.0
    The screenshots in external tutorial does not match the Assign component window.
    I started a new asynchronous SOA BPEL composite and then dragged an assign component in the middle of the recieveInput and callbackClient. Now I double clicked the Assign1 icon and get the "copy Rules" tab but I do not see any LOV in the top left which would have "expression" as a value as I want to concatenate the input string with "hello". I see a "Fx Calculator Icon" which I am supposed to drag to the target node but I can not drag it to the input node. Isn't possible to write an expression to the source node ?

    Hi,
    the assign activity changes a little bit between the versions of the JDeveloper. But we can figure it out, if you want to concatenate the input variable element and assign to the element of Output variable, what you can do is, drop an expression builder on the element of the output variable; then inside that expression builder you can use concat xpath function.
    I beleieve in 11.1.1.3 version, if you want to append and assign to a target variable; we need to drop an assign activity, select copy operation; then select the expression as Type and write the concat expression in that window and on the right hand side, we need to select the variable for whome you want to assign the concatanated value.
    Hope this helps,
    N

  • How 2 better build this Expression?

    As you can see in the code below a null means don't use this object in the criteria. Conditionally building an Expression like this is rather cumbersome. There has got to be a better way to do this!
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expression = null;
    if (name != null) {
    expression = builder.get("name").equal(name);
    if (age != null) {
    if (expression == null) {
    expression = builder.get("age").equal(age);
    else {
    expression = expression.and(builder.get("age").equal(age));
    Collection persons = null;
    if (expression == null) {
    session.readAllObjects(Person.class);
    else {
    session.readAllObjects(Person.class, expression);

    One thing that may help is that expression.and will allow you to pass in null (just returns the expression).
    So...&gt;&gt;
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expression = null;
    if (name != null) {
    expression = builder.get("name").equal(name);
    if (age != null) {
    expression = (builder.get("age").equal(age)).and(expression);
    Collection persons = session.readAllObjects(Person.class, expression);
    You can also use query by example, which makes simple queries much simpler.

  • How to retrieve a part of XML document

    Dear Everyone
    I am using
    Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
    Berkeley DB 4.6.21: (September 27, 2007)
    with python api on mac OSX.
    I want to copy a part of XML document within the document.
    For example, assume that we have the following XML in dbxml.
    <A>
    <B id="1">
    <C>hello</C>
    <D>hi</D>
    </B>
    </A>
    I want to copy <B> with different "id" like,
    <A>
    <B id="1">
    <C>hello</C>
    <D>hi</D>
    </B>
    <B id="2">
    <C>hello</C>
    <D>hi</D>
    </B>
    </A>
    How can I do this?
    One more question. I want to retrieve a part of XML as string.
    For example,
    I want to have a string ' <B id="1"><C>hello</C><D>hi</D></B>'
    How can I do this?
    Thank you very much for your kind help in advance.
    Best regards,
    -Yoshi

    Hi,
    I couldn't add a document like you described:
    dbxml
    dbxml> createC test.dbxml
    dbxml> putD "mydoc" "<C>hello</C><D>hi</D>" "s"
    stdin:5: putDocument failed, Error: Error: XML Indexer: Fatal Parse error in document at line 1, char 13. Parser message: Expected comment or processing instruction (Document: mydoc)
    but, if I fix it and make it well formed it worked, so for
    the experiment I did that:
    dbxml> putD "mydoc" "<mydoc><C>hello</C><D>hi</D></mydoc>" "s"
    Document added, name = mydoc
    I could have added as two separate documents, document 1: <C>hello</C>,
    document 2: <D>hi</D>, but, I don't know what you are trying to do, so
    I'll stick with this example to the first.
    Then I ran a query to show what you did:
    dbxml> query 'collection("test.dbxml")/mydoc/*'
    2 objects returned for eager expression 'collection("test.dbxml")/mydoc/*'
    dbxml> print
    <C>hello</C>
    <D>hi</D>
    I can do the same thing using a query that returns something:
    dbxml> query 'for $i in collection("test.dbxml")/mydoc/* return $i'
    2 objects returned for eager expression 'for $i in collection("test.dbxml")/mydoc/* return $i'
    dbxml> print
    <C>hello</C>
    <D>hi</D>
    This duplicates, but the wrong way:
    dbxml> query 'for $i in collection("test.dbxml")/mydoc/* return ($i,$i)'
    4 objects returned for eager expression 'for $i in collection("test.dbxml")/mydoc/* return ($i,$i)'
    dbxml> print
    <C>hello</C>
    <C>hello</C>
    <D>hi</D>
    <D>hi</D>
    dbxml> query 'for $j in (1,2) for $i in collection("test.dbxml")/mydoc/* return $i'
    4 objects returned for eager expression 'for $j in (1,2) for $i in collection("test.dbxml")/mydoc/* return $i'
    dbxml> print
    <C>hello</C>
    <D>hi</D>
    <C>hello</C>
    <D>hi</D>
    And, finally, for your last string example:
    dbxml> query 'for $i in collection("test.dbxml")/mydoc/C for $j in collection("test.dbxml")/mydoc/D return concat("<C>",$i,"</C>", "<D>", $j, "</D>")'
    1 objects returned for eager expression 'for $i in collection("test.dbxml")/mydoc/C for $j in collection("test.dbxml")/mydoc/D return concat("<C>",$i,"</C>", "<D>", $j, "</D>")'
    dbxml> print
    <C>hello</C><D>hi</D>
    I don't get the 'id' change though.
    I hope this helps.
    -g

  • How to pass a string variable in a single quote

    Hi,
    I am trying to pass a single quoted string, 'some string', into a concat expression.
    My situation is some thing like
    I have an array of states
    <copy>
    <from>
    <ListOfValues xmlns="http://tbone.coi.test/amis">
    <!-- State -->
    <Value>A</Value>
    <Value>B</Value>
    <Value>C</Value>
    </ListOfValues></from>
    <to variable="StateList"/>
    </copy>
    then I loop through the StateList array to get each state as
    <copy>
    <from variable="StateList" query="/tns:ListOfValues/tns:Value[bpws:getVariableData('iterator')]"></from>
    <to variable="currentState"/>
    </copy>
    I then build an xpath expression like:
    <copy>
    <from expression="concat('/nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = ',bpws:getVariableData('currentState'), ']')"></from>
    <to variable="xpath"/>
    </copy>
    As the result, my xpath look like:
    /nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = A]
    but I need a state surrounded by single quote as 'A' or xpath query like
    /nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = 'A']
    Any ideas how can I single quote a value of bpws:getVariableData('currentState') in my concat expression
    Thanks,
    -V

    Have you tried 'the string contain''s an &apos;'?

  • Problem to send result from log file, the logfile is to large

    Hi SCOM people!
    I have problem when monitoring a log file on a Red Hat system, I get a alert that tells me that the log file is too large to send (see the alert context below).I guess that the problem is that the server logs to much between the 5 minutes that SCOM checks.
    Any ideas how to solve this?
    Date and Time: 2014-07-24 19:50:24
    Log Name: Operations Manager
    Source: Cross Platform Modules
    Event Number: 262
    Level: 1
    Logging Computer: XXXXX.samba.net
    User: N/A
     Description:
    Error scanning logfile / xxxxxxxx / server.log on values ​​xxxxx.xxxxx.se as user <SCXUser><UserId>xxxxxx</UserId><Elev></Elev></SCXUser>; The operation succeeded and cannot be reversed but the result is too large to send.
    Event Data:
    < DataItem type =" System.XmlData " time =" 2014-07-24T19:50:24.5250335+02:00 " sourceHealthServiceId =" 2D4C7DFF-BA83-10D5-9849-0CE701139B5B " >
    < EventData >
      < Data > / xxxxxxxx / server.log </ Data >
      < Data > ​​xxxxx.xxxxx.se </ Data >
      < Data > <SCXUser><UserId>xxxxxx</UserId><Elev></Elev></SCXUser> </ Data >
      < Data > The operation succeeded and cannot be reversed but the result is too large to send. </ Data >
      </ EventData >
      </ DataItem >

    Hi Fredrik,
    At any one time, SCX can return 500 matching lines. If you're trying to return > 500 matching lines, then SCX will throttle your limit to 500 lines (that is, it'll return 500 lines, note where it left off, and pick up where it left off next time log files
    are scanned).
    Now, be aware that Operations Manager will "cook down" multiple regular expressions to a single agent query. This is done for efficiency purposes. What this means: If you have 10 different, unrelated regular expressions against a single log file, all of
    these will be "cooked down" and presented to the agent as one single request. However, each of these separate regular expressions, collectively, are limited to 500 matching lines. Hope this makes sense.
    This limit is set because (at least at the time) we didn't think Operations Manager itself could handle a larger response on the management server itself. That is, it's not an agent issue as such, it's a management server issue.
    So, with that in mind, you have several options:
    If you have separate RegEx expressions, you can reconfigure your logging (presumably done via syslog?) to log your larger log messages to a separate log file. This will help "cook down", but ultimately, the limit of 500 RegEx results is still there; you're
    just mitigating cook down.
    If a single RegEx expression is matching > 500 lines, there is no workaround to this today. This is a hardcoded limit in the agent, and can't be overridden.
    Now, if you're certain that your regular expression is matching < 500 lines, yet you're getting this error, then I'd suggest contacting Microsoft Support Services to open an RFC and have this issue escalated to the product team. Due to a logging issue
    within logfilereader, I'm not certain you can enable tracing to see exactly what's going on (although you could use command line queries to see what's happening internally). This is involved enough where it's best to get Microsoft Support involved.
    But as I said, this is only useful if you're certain that your regular expression is matching < 500 lines. If you are matching more than this, this is a known restriction today. But with an RFC, even that could at least be evaluated to see exactly the
    load > 500 matches will have on the management server.
    /Jeff

  • Concatenate Two Fields Using EQL

    I am trying to concatenate two fields my company has in Endeca and am not being able to accomplish this. I have a Call_Num field and a Task_Num field. I would like to combine these fields with a hyphen in between. In the SQL queries I have written, I've been able to do this by typing: Call_Num || '-' || Task_Num. I tried this in EQL and am told that it doesn't recognize the ||. I tried using the keyword Concat (like you do in Excel) - CONCAT(Call_Num, '-', Task_Num), and it didn't recognize that either. I spoke to someone else in my company who uses Endeca and they told me that I need to convert Call_Num and Task_Num to integers (both fields are currently formatted as text - which is what I want, because Task_Num usually starts with a 0), multiply them by 1000 and then add them together. That isn't what I'm looking for either.
    I feel like I'm banging my head against a brick wall. I've been working on this simple task for about an hour now and have not met with any success.
    Any assistance you can provide would be greatly appreciated.

    EQL is for run-time querying, whereas you want the index to contain this as a concatenated property. Either generate this property as a concatenated version in your data feed to Endeca, or add a Record Manipulator to your pipeline of:
    <EXPRESSION TYPE="VOID" NAME="CREATE">
    <EXPRNODE NAME="PROP_NAME" VALUE="_YourConcatenatedAttribute"/>
    <EXPRESSION TYPE="STRING" NAME="CONCAT">
    <EXPRESSION TYPE="PROPERTY" NAME="IDENTITY">
    <EXPRNODE NAME="PROP_NAME" VALUE="Call_Num"/>
    </EXPRESSION>
    <EXPRESSION TYPE="STRING" NAME="CONST">
    <EXPRNODE NAME="VALUE" VALUE="-"/>
    </EXPRESSION>
    <EXPRESSION TYPE="PROPERTY" NAME="IDENTITY">
    <EXPRNODE NAME="PROP_NAME" VALUE="Task_Num"/>
    </EXPRESSION>
    </EXPRESSION>
    </EXPRESSION>
    Define a property in your pipeline and then map "\_YourConcatenatedAttribute" to this (the "_" prefix just reminds you that the source attribute is programmatically generated rather than being the name of a property in your source data). You can then use this concatenated property for any sorting, filtering etc. you want to do.
    Michael

  • Query with namespaces

    Hello,
    the issue is that when I make the query the objects returned are 0.
    The registries are like this:
    <Invoice
    xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
    xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
    xmlns:udt="urn:un:unece:uncefact:data:specification:Unqualifi
    edDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance" xmlns:ccts="urn:un:unece:uncefact:documentation:2"
    xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
    <cbc:UBLVersionID>2.0</cbc:UBLVersionID>
    <cbc:CustomizationID>CCIUBL</cbc:CustomizationID>
    <cbc:ProfileID>urn:invinet:profile:solofac-1.0</cbc:ProfileID>
    <cbc:ID>0-2007</cbc:ID>
    <cbc:CopyIndicator>false</cbc:CopyIndicator>
    <cbc:IssueDate>2007-04-01</cbc:IssueDate>
    <cbc:InvoiceTypeCode>Comercial</cbc:InvoiceTypeCode>
    </Invoice>
    I have defined the 'cbc' namespace:
    dbxml> setNamespace "cbc"
    "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
    And the query is, for example:
    dbxml> query 'collection("invoices1.dbxml")/Invoice/cbc:ID'
    0 objects returned for eager expression 'collection("invoices1.dbxml")/Invoice/cbc:ID'
    This example, without the 'cbc' namespace, works correctly.
    Thanks.

    Hi,
    I just tried this on my system using version 2.3.10 creating a default container in the shell (IN).
    Here is what I got:
    dbxml> query 'collection("forum1")/Invoice/cbc:ID'
    Query - Starting query execution
    Query - forum1 - U : [1] 2
    Query - Finished query execution, time taken = 23.747ms
    1 objects returned for eager expression 'collection("forum1")/Invoice/cbc:ID'
    dbxml> print
    <cbc:ID xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">0-2007</cbc:ID>
    Did the setNamespace report any errors? Are you using the current version?
    Ron

  • Export Groups to Files in Folders

    I'm following up on the great script posted here:
    http://forums.adobe.com/thread/488255?tstart=0
    I'm trying to add 2 things
    Save using ExportType.SAVEFORWEB
    Display an options box in the dialog to choose whether to save the files in separate folders named after the group names
    But I cannot get any of those to work.
    Any ideas how to do it?
    Thanks!

    I’ve added a clause to show only one of the selected layerSets at a copy and leave the rest of the layers’ visibility unchanged … maybe it works for Your purpose:
    // creates save for web-jpg-copies of mutually hidden layersets with dialog to select layersets and suffix;
    // be advised: existing files of identical names will be overwritten without warnings;
    // 2009, pfaffenbichler, use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    // get document-path and -title;
    var myDocument = app.activeDocument;
    var myDocName = myDocument.name.match(/(.*)\.[^\.]+$/)[1];
    var myPath = myDocument.path;
    var theLayerSets = collectLayerSets(myDocument);
    ////// filter for checking if entry is numeric, thanks to xbytor //////
    numberKeystrokeFilter = function() {
    this.text = this.text.replace(",", "");
    this.text = this.text.replace(".", "");
    if (this.text.match(/[^\-\.\d]/)) {
    this.text = this.text.replace(/[^\-\.\d]/g, "");
    if (this.text == "") {
    this.text = "0"
    // create the dialog;
    var dlg = new Window('dialog', "pdfs from layersets", [500,300,930,870]);
    //create list for layer-selection;
    dlg.layerRange = dlg.add('panel', [21,20,279,475], "select layersets to create pdfs of");
    dlg.layerRange.layersList = dlg.layerRange.add('listbox', [11,20,240,435], '', {multiselect: true});
    for (var q = 0; q < theLayerSets.length; q++) {
    dlg.layerRange.layersList.add ("item", theLayerSets[q].name);
    dlg.layerRange.layersList.items[q].selected = true
    // entry for suffix;
    dlg.suffix = dlg.add('panel', [290,20,410,85], "enter suffix");
    dlg.suffix.suffixText = dlg.suffix.add('edittext', [11,20,99,40], "", {multiline:false});
    // entry for number;
    dlg.number = dlg.add('panel', [290,100,410,165], "start with #");
    dlg.number.startNumber = dlg.number.add('edittext', [11,20,45,40], "1", {multiline:false});
    dlg.number.addNumber = dlg.number.add('checkbox', [55,20,105,40], "add", {multiline:false});
    dlg.number.startNumber.onChange = numberKeystrokeFilter;
    // field to add layer-name;
    dlg.layerName = dlg.add('panel', [290,180,410,270], "layer-name");
    dlg.layerName.doAddName = dlg.layerName.add('radiobutton', [11,20,120,40], "add it");
    dlg.layerName.dontAddName = dlg.layerName.add('radiobutton', [11,45,120,65], "don’t add it");
    dlg.layerName.doAddName.value = true;
    // field to select target-folder;
    dlg.target = dlg.add('panel', [290,285,410,475], "target-folder");
    dlg.target.folderPerSet = dlg.target.add('checkbox', [11,20,100,40], "folder each");
    dlg.target.targetSel = dlg.target.add('button', [11,50,100,70], "select");
    dlg.target.targetField = dlg.target.add('statictext', [11,80,100,185], String(myPath), {multiline:true});
    dlg.target.targetSel.onClick = function () {
    var target = Folder.selectDialog("select a target folder");
    dlg.target.targetField.text = target.fsName
    // ok- and cancel-buttons;
    dlg.buildBtn = dlg.add('button', [220,490,410,505], 'OK', {name:'ok'});
    dlg.cancelBtn = dlg.add('button', [21,490,210,505], 'Cancel', {name:'cancel'});
    dlg.warning = dlg.add('statictext', [21,520,410,560], "be advised: existing files of the same name will be replaced without prompting", {multiline: true});
    dlg.center();
    var myReturn = dlg.show ();
    // in case of OK;
    if (myReturn == true && dlg.layerRange.layersList.selection.length > 0) {
    // get the number instead of the name;
    var theLayerSelection = new Array;
    var theColl = dlg.layerRange.layersList.items;
    for (var p = 0; p < dlg.layerRange.layersList.items.length; p++) {
    if (dlg.layerRange.layersList.items[p].selected == true) {
    theLayerSelection = theLayerSelection.concat(p);
    // collect the rest of the variables,
    var theSuffix = dlg.suffix.suffixText.text;
    var theNumber = Number (dlg.number.startNumber.text) - 1;
    var theLayerNameAdd = dlg.layerName.doAddName.value;
    var theDestination = dlg.target.targetField.text;
    var theNumbering = dlg.number.addNumber.value;
    var folderEach = dlg.target.folderPerSet.value;
    // save for web options;
    var webOptions = new ExportOptionsSaveForWeb();
    webOptions.format = SaveDocumentType.JPEG;
    webOptions.includeProfile = false;
    webOptions.interlaced = 0;
    webOptions.optimized = true;
    webOptions.quality = 80;
    // history state;
    var historyState = myDocument.activeHistoryState;
    // create the pdf-name;
    if (theSuffix.length > 0) {
    var aSuffix = "_" + theSuffix
    else {
    var aSuffix = ""
    // do the operation;
    for (var m = theLayerSelection.length - 1; m >= 0; m--) {
    var theLayer = theLayerSets[theLayerSelection[m]];
    theLayer.visible = true;
    // numbers;
    if (theNumbering == true) {
    theNumber = bufferNumberWithZeros((Number (theNumber) + 1), 2);
    theNumberString =  "_" + theNumber
    else {
    theNumberString = ""
    // get the layername for the pdf-name;
    if (theLayerNameAdd == true) {
    var aLayerName = "_" + theLayer.name.replace("/", "_")
    else {
    var aLayerName = ""
    // hide other layers;
    for (var n = theLayerSelection.length - 1; n >= 0; n--) {
    var aLayer = theLayerSets[theLayerSelection[n]];
    if (aLayer != theLayer && aLayer.visible == true) {
    aLayer.visible = false
    // create the individual folders;
    if (folderEach == true) {
    var aFolder = new Folder (theDestination+"/"+(theLayer.name.replace("/", "_"))).create();
    var theDestination2 = theDestination+"/"+(theLayer.name.replace("/", "_"))
    else {theDestination2 = theDestination};
    // hide the llast added layer;
    myDocument.exportDocument(new File(theDestination2+"/"+myDocName+aSuffix+aLayerName+theNumberString+".jpg"), ExportType.SAVEFORWEB, webOptions);
    myDocument.activeHistoryState = historyState;
    else {alert ("no document open")};
    ////// buffer number with zeros //////
    function bufferNumberWithZeros (number, places) {
    var theNumberString = String(number);
    for (var o = 0; o < (places - String(number).length); o++) {
    theNumberString = String("0" + theNumberString)
    return theNumberString
    ////// function collect all layersets //////
    function collectLayerSets (theParent) {
    if (!allLayerSets) {
    var allLayerSets = new Array}
    else {};
    for (var m = theParent.layers.length - 1; m >= 0;m--) {
    var theLayer = theParent.layers[m];
    // apply the function to layersets;
    if (theLayer.typename == "ArtLayer") {
    // allLayerSets = allLayerSets.concat(theLayer)
    else {
    // this line includes the layer groups;
    allLayerSets = allLayerSets.concat(theLayer);
    allLayerSets = allLayerSets.concat(collectLayerSets(theLayer))
    return allLayerSets

  • DBXML query help

    Hi,
    I am learning Berkeley DBXML using the command line interface. I figured out how to create a container and print out the full document. But, how do I print out only a section of the document?
    This is how I create the container:
    createContainer md9db.dbxml d validate
    openContainer md9db.dbxml
    addAlias md9db
    setNamespace "dif" "http://xxx.xxx.xxx/Aboutus/xml/dif/"
    putDocument entry5 xml_difs/dif5.xml f
    putDocument entry6 xml_difs/dif6.xml f
    putDocument entry7 xml_difs/dif7.xml f
    putDocument entry8 xml_difs/dif8.xml f
    query collection("md9db")/*[contains(dif:Entry_ID,"")]
    What I don't understand is how to get only a section of the document to print.
    For example, this query returns empty list:
    dbxml> query collection("md9db")/dif/Entry_ID
    0 objects returned for eager expression 'collection("md9db")/dif/Entry_ID'
    And this query returns empty string.
    dbxml> query collection("md9db")/string(dif:Entry_ID)
    4 objects returned for eager expression 'collection("md9db")/string(dif:Entry_ID)'
    dbxml> print
    dbxml>
    Is there any other setting I need to add to my container?
    Thanks,
    Rosy

    Hi Rosy,
    query
    collection("md9db")/*[contains(dif:Entry_ID,"")]You can put { curly braces } around your query, this eliminates the need to getridofallspaces.
    In the shell, the container you've last opened can be addressed using collection(), without resorting to aliasing, which on the other hand is very useful and good to know about.
    Note that your above query is just an inefficient version of collection()/*/dif:Entry_ID. You're testing for the presence of dif:Entry_ID, which is sufficient; contains( some_node, "") will always return true for strings.
    What I don't understand is how to get only a section
    of the document to print.
    For example, this query returns empty list:
    dbxml> query collection("md9db")/dif/Entry_ID
    0 objects returned for eager expression
    'collection("md9db")/dif/Entry_ID'Now take a look at your expression - maybe you were thinking dif:Entry_ID but typing dif/Entry_ID?
    It may also be useful to use collection()/*, which matches all top level element nodes, regardless of name.
    And this query returns empty string.
    dbxml> query
    collection("md9db")/string(dif:Entry_ID)
    4 objects returned for eager expression
    'collection("md9db")/string(dif:Entry_ID)'We can't see your documents, so we don't know whether or not this is correct. I'd say it probably is. Maybe there are no text nodes in your documents, because all text they contain is in attribute nodes?
    Michael Ludwig

Maybe you are looking for

  • Read from a config file in File Adapter in SOA Suite 11g

    I want to read from a config file in order to determine whether to archive or delete the file after processing using file adapter in SOA Suite 11g. How do i do that.

  • Setting apache as a front end host-proxy web server for weblogic 10.3.3

    Hi , i have installed apache 2.2.21 in the red hat linux 6 environment.Now i am trying to set that apache web server as a front end host ,proxy web server for my weblogic 10.3 application server cluster. My apache is listening to the port 8080. What

  • Covert DocumentColorSpace CMYK to RGB?

    All, Is there a way to change a document's colorspace between CMYK and RGB? I know the Document.documentColorSpace says 'read-only', but according to the documentation, it seems like the Application.open() method has the ability to open the document

  • Error in PCR WorkFlow

    Hi , I  am working on PCR WorkFlows, the problem is the workflow is triggering but when i look at the errors in SWI1Container it is showing like "Resolution of rule AC50000134 for task TS50000075: no agent found" Can any one tell me what could be the

  • Pre not charging on touchstone

    Last night my Pre refused to charge while seated on the Touchstone. It is NOT a problem with the magnetic connection or the amout of power being supplied to the TS since I have been charging on the TS for several weeks with no problems until last nig