Mixed Arabic/Latin text confuson in a single String
Hi all,
I hope someone knows the answer to this issue!
I've got an application in Java which calls another app via a stored procedure and callable statement, passing various parameters across. One of these parameters is a buffer containing transaction information.
Now we're working on an Arabic language proof of concept, and when I create this buffer containing both Arabic, Latin and numeric data, the order of the string is messed up.
E.g.
The data may be (in order):
I
AED
17
شارة النقاط
1.7
101010
Test seventeen
17D
This appears in the buffer (with some padding) as:
IAED17شارة النقاط 1.7 101010Test seventeen 17D
As you can see, the order has changed - the numeric fields appear to have been included with the Arabic text.
This causes the API we're calling to break, as you can imagine - expected fields are not appearing in the right place in the buffer.
The string for the buffer is being built as follows:
StringBuffer paramBuffer = new StringBuffer(BUFFER_INITIAL_CAPACITY);
while (iterator.hasNext()) {
String fieldName = iterator.next().toString();
// Get Object using field name from Vector.
FieldApi field = (FieldApi)fields.get(fieldName);
tempCtr = tempCtr + field.getLength();
if (field.getLength() == 0) {
break; // We have reached end of the fields
//Add each formatted field to param.
paramBuffer.append(field.getString());
Now, I suspect that I could get around this by constructing a byte array and using a setBytes method on my callableStatement. However, the set up of my JDBC connection means that I can't use setBytes (translateBinary is set to true, giving a data type mismatch exception), and this set up is something I can't change.
I'm sure this is a problem with the fact that Arabic languages are right to left rather than left to right, and the String I create attempts to format it in this manner (and gets it a little confused when a numeral is next to Arabic text). Is there a way I can tell the String to leave things exactly as they're added, rather than attempting to format them?
Any help would be appreciated! :-)
Cheers,
Dan
P.S. I'm aware that what is displayed and what is actually there may not be the same, but when I inspect the contents of the buffer in the stored procedure, the order is indeed wrong.
Hi Dan,
Some time ago a faced a similar problem whenn preparing text for display. I solved it by wrapping the text in a html table, thus forcing the elements to remain in the exact order I wnated them in. Something as follows:
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
public class MixedArabic {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new MixedArabic().createGUI();
private String[] parts = new String[] { "AED", "17",
"\u0634\u0627\u0631\u0629 \u0627\u0644\u0646\u0642\u0627\u0637",
"1.7", "101010", "Test seventeen", "17D" };
private void createGUI() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new JLabel(createString(parts, false)),
BorderLayout.PAGE_START);
frame.add(new JLabel(createString(parts, true)), BorderLayout.PAGE_END);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
private String createString(String[] parts, boolean formatted) {
StringBuilder sb = new StringBuilder();
if (formatted) {
sb.append("<html><table><tr>");
for (String part : parts) {
sb.append(formatted ? "<td>" : ' ');
sb.append(part);
sb.append(formatted ? "</td>" : ' ');
if (formatted) {
sb.append("</tr></table></html>");
return sb.toString();
}Piet
Similar Messages
-
Mixing static and dynamic content in a single outputText value causes NPEs
Hi,
I am having a problem and I'm wondering if it is a result of my error or if this is a bug.
I am mixing dynamic and static content in the value attribute of tags (e.g., outputText). On initial page load, everything works fine. However, if the same view is reloaded (e.g., after a failed validation) I get an NPE from JSF:
[#|2006-10-24T08:49:03.756-0500|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=12;|StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at com.sun.faces.el.MixedELValueParser.getNextToken(MixedELValueParser.java:140)
at com.sun.faces.el.MixedELValueParser.parse(MixedELValueParser.java:123)
at com.sun.faces.el.MixedELValueBinding.getValue(MixedELValueBinding.java:60)
at javax.faces.component.UIOutput.getValue(UIOutput.java:147)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:82)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:201)
at com.sun.faces.renderkit.html_basic.LabelRenderer.encodeBegin(LabelRenderer.java:128)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:443)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:233)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:130)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:233)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:130)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:233)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:609)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:546)
at com.sun.faces.taglib.html_basic.PanelGridTag.doEndTag(PanelGridTag.java:460)
at org.apache.jsp.registration_jsp._jspx_meth_h_panelGrid_0(registration_jsp.java:324)
at org.apache.jsp.registration_jsp._jspx_meth_h_form_0(registration_jsp.java:223)
at org.apache.jsp.registration_jsp._jspx_meth_f_view_0(registration_jsp.java:157)
at org.apache.jsp.registration_jsp._jspService(registration_jsp.java:118)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:326)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:132)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:194)
at sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)My code looks like this:
<h:outputText escape="false"
value='<link href="#{myBean.styleSheet}" rel="stylesheet" type="text/css" />' />If I replace this with a much more convoluted set of tags, it works:
<h:outputText escape="false"
value='<link href="' /><h:outputText escape="false" value="#{myBean.styleSheet}"
/><h:outputText escape="false" value='" rel="stylesheet" type="text/css" />' />So is the problem that I am mixing dynamic and static content with a single value? If so, why does it work on the first view, and not after?
If it matters, I'm using the reference implementation version 1.1 (as included with NetBeans 5.5RC2) on SuSE 10.0 w/ JDK 1.5_09.
Thanks,
BillYes, that's how I originally had it, but then changed it to the outputText approach since a single tag could do what I wanted, as long as I was allowed to mix static and dynamic content within a single value.
I think this is a bug in JSF 1.1, since if what I am doing is illegal, it should throw an exception on the first page view, not work on first view and throw an exception on subsequent views. I'm guessing that this has something to do with the fact that on first page view it only runs the restore view and render response JSF phases, while on subsequent requests all of the phases will be run, and it's in one of those other phases that the exception is thrown.
For now, multiple tags is the work-around, I guess.
Thanks,
Bill -
URGENT update a table with a text that has a single quote in it
Hello, I am trying to update a table with a text that has a single quote in it. I believe I need to use two singles quotes but I am not sure how.
For example:
UPDATE TEST
SET DESCRLONG='Aux fins d'exportations'
WHERE etc...
Should I put 2 singles quotes before the quote in the text?
UPDATE TEST
SET DESCRLONG='Aux fins d'''exportations'
WHERE etc...
Thank you very much :)The best way depends on the version of Oracle.
But, the quick and universal answer is to use two single quotes
SQL> connect test/test
Connected.
SQL> create table test (descrlong varchar2(128));
Table created.
SQL> insert into test values ('This is a string with a '' single quote');
1 row created.
SQL> select * from test;
DESCRLONG
This is a string with a ' single quote
SQL> update test set descrlong='Aux fins d''exportations'
2 where descrlong like 'T%';
1 row updated.
SQL> select * from test;
DESCRLONG
Aux fins d'exportations
SQL> -
Getting Separate Movable Text Elements In a Single Layer?
Is there any way to have more than one text placement inside of a single layer, but be able to maintain and move each of those separately from the others? From what I have seen, each new Text item gets its own new layer. If I want to document an image with seven points of reference, it's absolutely crazy that I have to maintain seven layers, each with an integer 1, 2, 3, 4, 5, 6, or 7. What would be much more maintainable is to create ONE layer and name it "MAP-NUMBERS" and then have seven integers placed into that one layer. I would then want to be able to move - say - "2" around separately from "4". Then making all of the numbers appear or disappear becomes as easy as hiding or showing one layer.
Is there a way to do this with any version of Photoshop?pone33 a écrit:
If I convert each text layer to a bitmap, and I then merge the bitmaps, I end up with a single joined bitmap. That's not useful.
Yes, it may be useful if the purpose is only to move the bitmaps around.
I want to have multiple text objects on a single layer.
Definitely impossible with any version of Elements...
That lets me group six or more related concepts (e.g., one index or nametag per person in a photo) to a single layer.
That's what I have done in my example of a group shot of 42 persons, and I was glad to use separate layers for that purpose.
Why would I want the names of seven people in seven different layers? I mean - honestly - no one has that requirement. It only makes maintenance of the layers very difficult.
The reason is that having layers is not the goal, it's the means of having full control over distinct objects : size, color, location, font, layer style... For instance, I was able to slightly change the size and location of my indexing numbers, which would have been impossible with already simplified bitmaps. The autoselect feature enabled me to automatically select the layer of the object. As a matter of fact, I did not have the concept of layers in mind when selecting and moving indexes. As for maintenance, I always have full control and I feel the result is logical, detailed but not difficult.
Yes, what is powerful is generally complex, and the layers panel is not simple in that case. Note that with a vector software, you'll have to deal with many items in an object list : I can understand that it may be more convenient for you. -
How can i recognize mixed format of text?
Mission:
if some text has "regular" fontstyle, i apply to it Bold style. And if it have mixed fontstyle (both bold and regular) i would like apply the Bold Italic style. But i discovered, that property FontStyle of text with mixed style is "Regular"! Then how can i recognize mixed format of text?
Thanks.When you have a text reference, check to see how many textStyleRanges it has. If more than one, you have mixed formatting. Check the style of each textStyleRange.
Dave -
Is there a way to mix functions with text within a formula?
eg =DATEDIF("21/9/96";NOW();"Y")&DATEDIF("21/9/96";NOW();"YM") produces 183
How do I parse this formula to produce 18y 3m?
All my attempts produce a parsing error.
I'd like to avoid splitting the result into two adjacent cells (my current solution).
MacBook Pro (Retina, 13-inch, Late-2012) - 8GB mem - 128GB SSD - OS X 10.10.1 - Numbers 3.5.2 (2118)Hi zebadee,
I adjusted the dates and syntax for my region but this should work once you adjust it back.
While this gives you the desired result it will not be recognized as a duration in Numbers. If you are looking to use this value as a duration you will need to use weeks.
Hope this helps.
quinn -
Where do I find a translation for the Latin text on the card I am using...
Try searching "greeking" on google. There is a good article on Wikipedia that describes the source for the text, which is basically meaningless. "Lorem ipsum sit amet dolor." This text has been used forever as filler when previewing designs. It looks like real text, but the viewer isn't distracted by reading meaningful text.
-
Single string tag expanded into 100 plc register values
I found a way to read 100 registers of plc data with a single string tag, if you can guarantee that none of the plc registers are zero. A register value of zero acts like a Null ascii terminator and truncates the string. Define the string tag as 200 bytes and uncheck the text data only box. Use the code in the attached picture to convert the string bytes back into decimal register values.
Attachments:
string tag to 100 U16 values.gif 2 KBIns't that code exactly the same as typecasting to an U16 Array?
Message Edited by altenbach on 05-19-2005 07:24 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
CastingU16.gif 3 KB -
Is there a way in Oracle to return multiple rows as a single string?
Hi gurus,
I just got help from your guys fixing my dynamic sql problem. What I am doing in that function is to return a single string from multiple rows and I use it in the select statement. It works fine once the problem was solved. But is there any way in Oracle to do this in the select statement only? I have a table that stores incidents (incident_id is the PK) and another table that stores the people that are involved in an incident.
Incident_table
(incident_id number PK);
Incident_people_table
(incident_id number PK/FK,
person_id number PK);
Now in a report, I need to return the multiple rows of the Incident_People_table as a single string separated by a comma, for example, 'Ben, John, Mark'. I asked the SQL Server DBA about this and he told me he can do that in SQL Server by using a variable in the sql statement and SQL Server will auomatically iterate the rows and concatenate the result (I have not seen his actual work). Is there a similar way in Oracle? I have seen some examples here for some similar requests using the sys_connect_by_path, but I wonder if it is feasible in a report sql that is already rather complex. Or should I just stick to my simpler funcion?
Thanks.
BenHi,
May be, this example will help you.
SQL> CREATE TABLE Incident_Table(
2 incident_id number
3 );
Table created.
SQL> CREATE TABLE Person_Table(
2 person_id number,
3 person_name VARCHAR2(200)
4 );
Table created.
SQL> CREATE TABLE Incident_People_Table(
2 incident_id number,
3 person_id number
4 );
Table created.
SQL> SELECT * FROM Incident_Table;
INCIDENT_ID
1
2
SQL> SELECT * FROM Person_Table;
PERSON_ID PERSON_NAME
1 John
2 Mark
3 Ben
4 Sam
SQL> SELECT * FROM Incident_People_Table;
INCIDENT_ID PERSON_ID
1 1
1 2
1 3
2 1
2 2
2 4
6 rows selected.
SQL> SELECT IT.*,
2 (
3 WITH People_Order AS (
4 SELECT IPT.incident_id, person_id, PT.person_name,
5 ROW_NUMBER() OVER (PARTITION BY IPT.incident_id ORDER BY PT.person_name) AS Order_Num,
6 COUNT(*) OVER (PARTITION BY IPT.incident_id) AS incident_people_cnt
7 FROM Incident_People_Table IPT
8 JOIN Person_Table PT USING(person_id)
9 )
10 SELECT SUBSTR(SYS_CONNECT_BY_PATH(PO.person_name, ', '), 3) AS incident_people_list
11 FROM (SELECT * FROM People_Order PO WHERE PO.incident_id = IT.incident_id) PO
12 WHERE PO.incident_people_cnt = LEVEL
13 START WITH PO.Order_Num = 1
14 CONNECT BY PRIOR PO.Order_Num = PO.Order_Num - 1
15 ) AS incident_people_list
16 FROM Incident_Table IT
17 ;
INCIDENT_ID INCIDENT_PEOPLE_LIST
1 Ben, John, Mark
2 John, Mark, SamRegards,
Dima -
Concate mutiple input in to Single String.
Hi ,
I need one help .
I want to contcat the one of the IDOC fields occurance in a single string. Please let me know how to user.
For Ex. I am mapping one field of Idoc ex TDLINE --> Extrinsic (0.. Unbounded)in the output side.
In the Input side the TDLINE fields appears multiple time. in the current mapping I have one to one mapping between TDLINE and Extrinsic fields. So it creates the same number of Extrinsic fields as I have TDLINE fields at input side.
What I want to do , I want to create a single Extrinisc fields at output side for all the TDLINE fields.
For Ex. At particaular segment I have 10 fields for TDLine then all should come as Single string at out put side.
Note . No of Occurance of TD line is 0.. unbounded).
Please give ur suggestions for the same.Hi Ram,
i got same problem recently. For this problem there is no standard functions in XI so you must create udf. I wrote that udf and sending with these:
http://allyoucanupload.webshots.com/v/2003800853095440083
http://allyoucanupload.webshots.com/v/2003854577844519372
http://allyoucanupload.webshots.com/v/2003865357113273227
http://allyoucanupload.webshots.com/v/2003828767547920796
Regards,
Sai -
I apologize if the question is trivial, but I have been working on it for a while.
I would like to send a single string containing one XML element to the parser. I can't figure out a way to do it.
Of course, I can easily parse files, but for communication purposes, I need a way to parse just single elements, that are stored in separate strings, and find out their contents.
Thank you,
SolCan't your parser accept a Reader as input? Check its API documentation to find that out. If it can, then "whatever.parse(new StringReader(yourXmlString))" is what you want.
-
Convert the IDOC XML file into single string?
Hello All,
I have a scenario, where i need to conver the IDOC XML into single string, to send it to target.
Please let me know how can we achive this, I dont know java coding.
Please help me out to write the java code.
Thanks and Regards,
ChinnaHi Chinna,
You can do this in two ways -
1. Java mapping
https://wiki.sdn.sap.com/wiki/display/XI/JavaMapping-ConverttheInputxmlto+String
https://wiki.sdn.sap.com/wiki/display/Snippets/JavaMapping-ConverttheInputxmltoString
2. XSLT mapping
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Regards,
Sunil Chandra -
Convert an array of strings into a single string
Hi
I am having trouble trying to figure out how to convert an array of strings into a single string.
I am taking serial data via serial read in a loop to improve data transfer. This means I am taking the data in chunks and these chunks are being dumped into an array. However I want to combine all elements in the array into a single string (should be easy but I can't seem to make it work).
In addition to this I would also like to then split the string by the comma separator so if any advice could be given on this it would be much appreciated.
Many Thanks
Ashley.Well, you don't even need to create the intermediary string array, right? This does exactly the same as CCs attachment:
Back to your serial code:
Why don't you built the array at the loop boundary? Same result.
You could even built the string directly as shown here.
Message Edited by altenbach on 12-20-2005 09:39 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
autoindexing.png 5 KB
concatenate.png 5 KB
StringToU32Array.png 3 KB -
Concatenate fields on multiple child rows into one single string
Hi -
I'm pretty much new to BI Publisher, and I looked through the forums for what I was trying to do below, but couldn't find much on this.
Here's my data source:
<BUSINESSES>
<BUSINESS>
<NAME>Microsoft</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Apple</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Google</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Yahoo</NAME>
</BUSINESS>
</BUSINESSES>
What I was trying to do is create a single string from the XML data source in the form
Microsoft,Apple,Google,Yahoo,............
Here was my plan to do this:
1. Create a global variable - <?variable:AllNames;''?>
2. Loop - For each BUSINESS
2a. Capture NAME - <?variable@incontext:BusName;'NAME'?>
2b. Concatenate it to the global variable AllNames - <?variable:AllNames;concat($AllNames,',',$BusName)?>
3. End Loop
4. Display global variable - <?$AllNames?>
I get a blank RTF when I run this.
Can someone please advice me on this? I thought it would be pretty simple to do, but here i am at the end of the day, and ...
Thank you.There are multiple ways to do it..
one option of using variable, which i would not certainly do is this :)
<?xdoxslt:set_variable($_XDOCTX,'TESTTEST’,’’)?>
<?for-each:/BUSINESSES/BUSINESS?>
<?position()?>: <?NAME?> <?xdoxslt:set_variable($_XDOCTX,'TESTTEST’, concat(xdoxslt:get_variable($_XDOCTX,'TESTTEST’),’,’ ,NAME) )?>
<?end for-each?>
<?xdoxslt:get_variable($_XDOCTX,'TESTTEST’)?> -
Multiple strings input to single string output
Dear all,
this program is needed for my demo simulation purposes, I'm creating several string inputs to show into a single string output updating (input strings are shown in each line). i attached the picture below, put 2 output strings w/c both doesn't meet my desired result:
1.) 1st string output - replace the old string w/ new string. what i need is to maintain also the previous strings. the new string will go to the next line.
2.) 2nd string output - although i got all the strings i needed, it only appears right after the while loop terminates, so i did not see the string inputs updating.
i'm using LV 8.5.1., any help is appreciated... posting your correct code will be more appreciated.
thanks in advance...
Ivel R. | CLAD
Solved!
Go to Solution.here's my code for anyone to see the actual difference.
thanks,
Ivel R. | CLAD
Attachments:
update strings.vi 14 KB
Maybe you are looking for
-
EJB problem (Seam 2.1.2 + WLS 10.3)
Hi, I'm having some problems getting the EJB version of the booking example in Seam 2.1.2 working with WebLogic 10.3, and I'm hoping that someone here might have some advice. I followed the instructions in Chapter 39 of the Seam documentation for bui
-
Derived tables and Order by clause
Hi, I have a query that looks as below. The execution time of the query (10 sec) is fine when order by clause is removed from the query. But with order by clause, the execution time is 40 times more(400 sec). How to optimize this query so that it wil
-
HT2534 none option is not available in the page
none option is not available in the page. Kindly help me to review my apple id without giving credit card details. Thank you.
-
I have a French computer running on 32 bits instead of 64 (Vista). Reinstalled several times the latest iTunes but keep on having failure 42110!! No download available for 32 bits???? This is more an Apple support question!!
-
This is my code for the 99 bottles of beer on the wall song... I got the idea from a book and said, hey neat, I should try that: class beerSong{ public static void main(String[] args){ int beerNum = 99; when(beerNum > 1); {