XML Data Conversion Problem
Hi,
Am facing problem in flex that using web services am getting the data in xml format (below provided) am not able to provide the data from xml to datagrid. Am getting the data in datagridcolumn with the tag also. I need only data to be displayed without the child tag in the datagrid.
XML Format output as below:
<UDSObjectList>
<UDSObject>
<Handle>cr:400503</Handle>
<Attributes>
<Attribute DataType="2005">
<AttrName>ref_num</AttrName>
<AttrValue>671</AttrValue>
</Attribute>
<Attribute DataType="2005">
<AttrName>impact</AttrName>
<AttrValue>5</AttrValue>
</Attribute>
<Attribute DataType="2005">
<AttrName>priority</AttrName>
<AttrValue>1</AttrValue>
</Attribute>
</Attributes>
</UDSObject>
</UDSObjectList>
Attached the screenshot of output for your reference. The screenshot showing the datawith tag and here is other problem is for request id and impact and priority columns showing three columns data in all the columns.
Actual data is as below:
Request Id is 671
Impact is 5
Priority is 1
but the data is shown in all the columns not shown in related columns.
Thanks in advance..........
Can anyone provide a solution. As this problem was facing since long time.
Thanks
Similar Messages
-
I am trying to setup an XML data server and can't get passed the error: java.sql.SQLException: Could not generate the DTD because the file could not be created. Verify that you have write permission in the directory.
I have placed my xml file in the odi\demo directory where the sample files are and it doesn't seem to help. Here is the url I'm using: jdbc:snps:xml?f=../demo/xml/sample-incident-report1.xml
This url does not give the errors and connects w/o a problem: jdbc:snps:xml?f=../demo/xml/salesorg.xml
Same directory, one gives the error and one does not.
Thanks for any help.It seems that anything a little complex causes this error. I've tested with relatively flat xml documents and don't encounter the problem.
-
R/3 Date Conversion problem
How to convert the R/3 Date to Array.
If you are receiving a date field from R/3, please use <b>SimpleDateFormat</b>(class) to re-arrange your date in any fashion. Along with the method <b>format</b> you can just have your date in any format :
DD-MM-YYYY
MM-DD-YY
DD-MMMMM-YYYY (Month will be spelled out as text)
All you need to do is :
SimpleDateFormat sf = new SimpleDateFormat("DD/MM/YYYY");
sf.format(myDateField);
Since R/3 date conversion is usually for this reason, I mentioned the above class.
Regards,
Subramanian V. -
I have table xxemp(No number, Text varchar2(250)), i have created a report and generate xml file and create temple and load data and insert all
field and when i preview the data in rtf formate at that movement data is not shown in the text field not display.In text field content 3 line of data
Thanks
837please make sure, your xml data file has some data in it. and when the rtf is made view the output their itself.
let me know the steps you have followed.
Thanks
Ud. -
where will XML data is converted?
ThanksHi,
The adapters in the adapter engine will converts the source message to the xml message.
Thanks
SaNv... -
Char to Date conversion problem - again!
Hi,
in order to make date selection 'more attractive' for end users I have been tasked with presenting a text field with 'January 2010', 'February 2010' etc to the end users for their prompts.
So far so easy...
However, I then need to use the values to derive either dates, or years, or date numbers.
This all works fine during development when I am testing using a default parameter thus; -
'@{MYMONTHYEAR}{September 2010}' - which is fed into various very complex functions.
BUT - when I try to use the report in conjunction with the parameter I get; -
'The evaluation of the index 6 expression on row count -1 failed. [nQSError: 46046] Datetime value 2010/09/01 does not match the specifiied format'
However, cast('2010/09/01' as date) works fine... and convoluted as the logic of my functions is, the fundamental char to date conversion is exactly in this format.
Anyone shed any light on this, give me a guaranteed way to handle char to date conversion?
thanks,
Robert.Hi,
I tried your workaround case when 1=2... but I still get the same error....
Not when I have the format from my default value, but when I get the value from a dashboard prompt in a page.
The full error is; -
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 46046] Datetime value 2012/09/01 does not match the specified format. (HY000)
SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10, s_11, s_12, s_13, s_14, s_15, s_16, s_17, s_18, s_19, s_20, s_21, s_22, s_23, s_24, s_25, s_26, s_27, s_28, s_29, s_30, s_31, s_32, s_33, s_34, s_35, s_36, s_37, s_38, s_39, s_40, s_41, s_42, s_43, s_44, s_45, s_46, s_47, s_48, s_49, s_50, s_51, s_52, s_53, s_54, s_55, s_56, s_57 FROM ( SELECT 0 s_0, "Vivaldi Detail"."Product Global Hierarchy"."Tobacco Category Groups" s_1, "Vivaldi Detail"."Product Global Hierarchy"."Tobacco Category" s_2, "Vivaldi Detail"."Product Global Hierarchy"."Total Tobacco Products" s_3, FILTER("Vivaldi Detail"."Fact Sales Detail"."SOM %" USING ("Vivaldi Detail"."Time"."Year" =cast((cast(right('September 2012',4) as integer)-1) as char(4)))) s_4, FILTER("Vivaldi Detail"."Fact Sales Detail"."SOM %" USING ("Vivaldi Detail"."Time"."Year" =cast((cast(right('September 2012',4) as integer)-2) as char(4)))) s_5, FILTER("Vivaldi Detail"."Fact Sales Detail"."SOM %" USING ("Vivaldi Detail"."Time"."Year" =cast((cast(right('September 2012',4) as integer)-3) as char(4)))) s_6, FILTER(FILTER("Vivaldi Detail"."Fact Sales Detail"."SOM %" USING ("Vivaldi Detail"."Time"."Year" =cast((cast(right('September 2012',4) as integer)-1) as char))) USING "Vivaldi Detail"."Time"."Month Number" <=month(CASE WHEN 1=2 THEN CURRENT_DATE ELSE cast(right('September 2012',4)||'/'||CASE left('September 2012',LOCATE(' ','September 2012')-1) WHEN 'January' THEN '01/01' WHEN 'February' then '02/01' when 'March' then '03/01' when 'April' then '04/01' when 'May' then '05/01' when 'June' then '06/01' when 'July' then '07/01' when 'August' then '08/01' when 'September' then '09/01' when 'October' then '10/01' when 'November' then '11/01' ELSE '12/01' END as date)END)) s_7, FILTER(FILTER("Vivaldi Detail"."Fact Sales Detail"."SOM %" USING ("Vivaldi Detail"."Time"."Year" =right('September 2012',4))) USING "Vivaldi Detail"."Time"."Month Number" <=month(CASE WHEN 1=2 THEN CURRENT_DATE ELSE cast(right('September 2012',4)||'/'||CASE left('September 2012',LOCATE(' ','September 2012')-1) WHEN 'January' THEN '01/01' WHEN 'February' then '02/01' when A brief sample of a typical formula which causes this is; -
FILTER(FILTER(FILTER("Fact Sales Detail"."SOM %" USING ("Time"."Year" = right('@{MYEAR}{September 2010}',4))) USING ("Time"."Month Number" = 2)) USING "Time"."Month Number" <= month(CASE WHEN 1=2 THEN CURRENT_DATE ELSE cast(right('@{MYEAR}{September 2010}',4)||'/'||CASE left('@{MYEAR}{September 2010}', LOCATE(' ','@{MYEAR}{September 2010}') -1) WHEN 'January' THEN '01/01' WHEN 'February' then '02/01' when 'March' then '03/01' when 'April' then '04/01' when 'May' then '05/01' when 'June' then '06/01' when 'July' then '07/01' when 'August' then '08/01' when 'September' then '09/01' when 'October' then '10/01' when 'November' then '11/01' ELSE '12/01' END as date) END ))The September 2010 default being EXACTLY what is selected from the dashboard prompt when testing. It does not error, but returns no data in isolation, but when when from the prompt it errors...
And the date format, if fed into a cast ('2012/09/01' as date) does not error.
Anyone help - this is really driving me mad, syntax is good - it should work!!!
thanks,
Robert. -
Hi there,
I am creating a data source for XML....
all needed services are there (/SICF)
Web service was created..and it is active
I create DataSource..and I check it.... everything is Ok until here..
By activating the DataSource I got an error
<b>Error generating web service..</b>
what could be the problem ? or how could I know more about the problem...I do not get more than that message...
I will thank any help or advice
FedeXHi there,
I am creating a data source for XML....
all needed services are there (/SICF)
Web service was created..and it is active
I create DataSource..and I check it.... everything is Ok until here..
By activating the DataSource I got an error
<b>Error generating web service..</b>
what could be the problem ? or how could I know more about the problem...I do not get more than that message...
I will thank any help or advice
FedeX -
File XML Content Conversion: Problem with special characters
Hello,
in a file sender cc content conversion is used to transform a flat structure to XML. What we experiencecd is that the message mapping failed due to a character that was not allowed in XML:
I was assuming that the file content conversion just creates XML messages with allowed characters. Is there any way to configure content conversion to remove control characters which are not allowed in XML? Unfortunately the sender system cannot be modified.
Thank you.Hi Florian,
Please use this UDF to remove special characters which prevent XML messages to form properly.
public static String removeSpecialChar(String s)
try
s=s.replaceAll("&","& amp ;");
s=s.replaceAll("<" , " & lt ;");
s=s.replaceAll(">", "& gt ;");
s=s.replaceAll("'", "& apos ;");
s=s.replaceAll("\"", "& quot ;");
catch(Exception e)
e.printStackTrace();
return s;
Please remove spaces between characters within double quotes. I have added them because otherwise you can't see this code properly. Please check this below link , please replace the characters with proper values as the display is causing a problem here
http://support.microsoft.com/kb/316063
regards
Anupam
Edited by: anupamsap on Jul 7, 2011 4:22 PM
Edited by: anupamsap on Jul 7, 2011 4:23 PM -
Date conversion problem.
I use 2 adaptive RFC function with a r3 backend system:
1- Search
2- Update
The first works fine, I show the data, one of the fields is a date (with r3 Date format) binded and in the web dynpro is showed in inputfield, with a little calendar icon on the right.
I have problem with the second one. Cause I use the same inputfield for both RFC. I bind in design time with the Search RFC and for the update I pass the changed values to the 2nd RFC trought coding.
What I want is just to save in a Variable, the value of the binded UI element, with the string type I have no problem, but when I wanna save my date field in a String It say that the conversion cannot be done.
<u>EXAMPLE:</u>
String value1 = wdContext.currentTable_CelElement().getNumcel();
I wanna accomplish that example but With Date format. So the question would be How can I save in a Variable a Date format field of R3.
<b>"?" </b>value2 = wdContext.currentTable_CelElement().getFecha();
ThxHi!
I think that this problem occurs because of different Date formats in your Web Dynpro Application: The R/3-Date format is mapped to java.sql.Date, and for your variable you probably use java.util.Date.
If so, try to use the sql.Date for your variable, too, or make a conversion like this:
java.util.Date myDate = new java.util.Date(wdContext.currentTable_CelElement().getFecha().getTime());
Regards,
Thomas -
XML data set problems with Accordion widget
Hi,
I have a dataset, which returns the data as shown below:
<resultset>
<result>
<title>Title one<b>with parts of the title in
bold</b></title>
<otherAttributes/>
</result>
</resultset>
As you can see, some of the nodes may have markups, such as
<b> etc. I create the XML dataset as:
var myDataset = new Spry.Data.XMLDataSet("/path/to/my/URL",
"resultset/result");
And in AccordionPanelTab, I use the title property as shown
below.
<div class="AccordionPanelTab">{title}</div>
But this doesn't work. The Tab displays no titles. If I
remove the <b/> in the <title> it works fine as
expected. My problem is, some titles may have additional mark ups
and some may not. How can I handle this problem?
Any help is greatly appreciated.
Cheers,
Rag.Forgot to mention that the data comes from third party
service providers, so I have no control over it. For ex: I cannot
have title in a CDATA section. -
Jasper Report with XML data Source problem
I have a problem in getting a report run on my machine..
I have a report that uses XML-dataSource to read info stored in xml file, I use XPath query to traverse xml nodes,
I have JBoss Server installed but the problem is that I want to know how to configure JBoss and tell it where to look for the xml file so the report can produce right information.
I use Windows XP and JBoss 4.23 and I finished the report using i-report 2.0.2
please I need the configuration steps to make this report work... thanx in advanceHi,
Have a look at below URL.
http://ireport.sourceforge.net/cap7.html#7.4
Regards
VInK -
I am trying to unflatten data from an xml file but my input type for the type on the unflatten I believe is invalid and I am getting error 1106.
Attached is the xml file and VI
XML file is in text due to upload constraints
Paul Power
I have not lost my mind, it's backed up on a disk somewhere
Solved!
Go to Solution.
Attachments:
TestData.txt 2 KB
XML Cluster.vi 35 KBYour data type cluster does not match your XML file. Fixed VI (LV version 2013) is attached. However, the file you posted appears to be a single element, not the entire file, so I cannot verify it works.
If you have an earlier version of LabVIEW, the cluster was missing a timestamp and had a cluster at the end which should have been a string.
Duplicate post from here.
This account is no longer active. Contact ShadesOfGray for current posts and information.
Attachments:
XML Cluster.vi 44 KB -
XML date transformation problem
HI Gentlemen,
I really do not know, why my XSLT functions behave so confused. I have an XML instance with several date fields in the form of YYYY-MM-DD, and YYYY-MM-DD.. (the second part of the date span is optional). For the German user I have to translate them into DD.MM.YYYY notation. Here is the code segment from my XSL stylesheet--the original date is decomposed and then again compiled into one unit. It works fine with the YYYY and DD portions, however it returns bad values for MM (being positions 5 and 6 after removing the minus signs.) Can anybody tell me if it is an Oracle bug or my fault? Only the middle positions are wrong. See the results after the code segment.
<!-- ************************** Gültigkeit ************************** -->
<a name="1"/>
<h4><xsl:text>1. Gültigkeit</xsl:text></h4>
<table>
<xsl:for-each select="pe:gueltigkeit">
<xsl:variable name="von_XML" select="substring-before(@V, '..')"/>
<xsl:variable name="von" select="translate($von_XML, '-', '')"/>
<xsl:variable name="von_TT" select="substring($von,7,8)"/>
<xsl:variable name="von_MM" select="substring($von,5,6)"/>
<xsl:variable name="von_JJJJ" select="substring($von,1,4)"/>
<xsl:variable name="von_DE" select="concat($von_TT, '.', $von_MM, '.', $von_JJJJ)"/>
<tr>
<td>von...bis</td>
<td><xsl:value-of select="@V"/></td>
<td><xsl:value-of select="$von_XML"/></td>
<td><xsl:value-of select="$von_TT"/></td>
<td><xsl:value-of select="$von_MM"/></td>
<td><xsl:value-of select="$von_JJJJ"/></td>
<td><xsl:value-of select="$von_DE"/></td>
</tr>
</xsl:for-each>
</table>
<br/>And the results as displayed by a browser:
|von...bis|1995-08-23..|19950823|23|0823|1995|23.0823.1995|
-----------------------------------------------------------The minus signs were only removed because I experienced that it returns a messy output of minuses and digits.
Thank you for your assistance in advance.
Kind regards:
Miklos HERBOLY
Edited by: mh**** on Aug 1, 2011 7:13 AM
Edited by: mh**** on Aug 1, 2011 7:15 AMHi,
Can anybody tell me if it is an Oracle bug or my fault?Actually, your fault ;)
The third argument of the substring function is not a position but a length.
http://www.w3.org/TR/xpath/#function-substring
So I guess this is what you're looking for :
<xsl:variable name="von_TT" select="substring($von,7,2)"/>
<xsl:variable name="von_MM" select="substring($von,5,2)"/>
<xsl:variable name="von_JJJJ" select="substring($von,1,4)"/> -
String to date conversion problem
Hai braniees,
i am new to java.I have a problem in converting string to date.my code is this
dob="2/05/2005";
SimpleDateFormat sf=new SimpleDateFormat("dd/MM/yyyy");
Date dt=sf.parse(dob);
i this i am getting the error in the last line.the error is
" Unhandled exception type ParseException"
I am not able to getrid of this.
Thanks
anieshukI would advise against doing what ranjithcp suggested unless you are such a perfect programmer that you'll never get invalid data into your methods. Also what ranjithcp has failed to mention is that you'll have to put the throws instruction all over your code right up to your main method otherwise your just moving your error message up through your program.
You should always try and handle checked exceptions not throw them. -
MS SQL Server 2005 Data Conversion Problem
Hello all,
I'm using the Microsoft JDBC Driver with SQL Server 2005 and getting an exception from the database server indicating that it is attempting to convert an nvarchar to an int (SQL Error 8114). This is the stack trace and code. I've exhausted all my resources... anybody have an idea?
com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type nvarchar to int.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.getPrepExecResponse(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement (Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
at com.boeing.ict.workmonitor.swing.JMainFrame$33.insertIntoDB (JMainFrame.java:986)
at com.boeing.ict.workmonitor.utils.SafeUDPWorker.respond(SafeUDPWorker.java:65)
at com.boeing.ict.workmonitor.utils.SafeNetWorker.runWork(SafeNetWorker.java:113)
at com.boeing.ict.workmonitor.utils.SafeNetWorker.access$000 (SafeNetWorker.java:21)
at com.boeing.ict.workmonitor.utils.SafeNetWorker$1.run(SafeNetWorker.java:59)
at java.lang.Thread.run(Unknown Source)
private void listenToCOTMessages() {
// the listener has not started yet.
if (cotMessageWorker == null) {
cotMessageWorker = new SafeUDPWorker() {
public void insertIntoDB(Iterator<NameValuePair> nvPairs) {
try {
int numParameters = 0;
if (isDebugMode()) {
System.err.println("Entered insertIntoDB");
while (nvPairs.hasNext()) {
NameValuePair pair = nvPairs.next();
// Aircraft callsign
if (pair.getName().equalsIgnoreCase("callsign")) {
cotStatement.setString(1, pair.getValue());
// debug code
System.err.println("{1} " + pair.getValue());
cotStatement.setString(2, pair.getValue());
// debug code
System.err.println("{2} " + pair.getValue());
numParameters++;
if (numParameters > 7)
break;
// Aircraft altitude (meters)
else if (pair.getName().equalsIgnoreCase("hae")) {
int height = Integer.parseInt(pair.getValue());
height = (int)((height * 39.37) / 12);
cotStatement.setInt(3, height);
// debug code
System.err.println("{3} " + height);
numParameters++;
if (numParameters > 7)
break;
// aircraft latitude N/S (+/-)
else if (pair.getName().equalsIgnoreCase("lat")) {
String rawLatitude = pair.getValue();
// we have a south latitude
if (rawLatitude.charAt(0) == '-') {
// we need to append an " S"
} else {
rawLatitude = rawLatitude.substring(1) + " S";
cotStatement.setString (4, rawLatitude);
System.err.println("{4} " + rawLatitude);
numParameters++;
if (numParameters > 7)
break;
// aircraft longitude E/W (+/-)
else if (pair.getName ().equalsIgnoreCase("lon")) {
String rawLongitude = pair.getValue();
// we have a west longitude
if (rawLongitude.charAt (0) == '-') {
rawLongitude = rawLongitude.substring(1) + " W";
cotStatement.setString(5, rawLongitude);
// debug code
System.err.println("{5}" + rawLongitude);
numParameters++;
if (numParameters > 7)
break;
// aircraft course
else if (pair.getName().equalsIgnoreCase("course")) {
cotStatement.setString(6, pair.getValue());
// debug code
System.err.println("{6} " + pair.getValue());
numParameters++;
if (numParameters > 7)
break;
// we have a speed number
else if (pair.getName ().equalsIgnoreCase("speed")) {
cotStatement.setInt(7, Integer.parseInt(pair.getValue()));
System.err.println("{7} " + pair.getValue ());
numParameters++;
if (numParameters > 7)
break;
else {
continue;
// execute the callable statement
cotStatement.execute();
} catch (SQLException ex) {
ex.printStackTrace();
// statusPanel.getStatusTextArea().append( ex.getMessage());
// set the debugging mode
cotMessageWorker.setDebugMode(debugMode);
// set the output area for the worker
cotMessageWorker.setMessageArea(cotTextArea);
String portField = cotPortTextField.getText();
// get the port setting from the portTextField
if (portField.length() != 0) {
try {
cotMessageWorker.setPort(Integer.parseInt(portField));
} catch (NumberFormatException nfe) {
cotPortTextField.setBackground(Color.RED);
cotMessageWorker.setStatusArea(statusPanel.getStatusTextArea());
// set the java.sql.Statement object to do the data insertion
if (cotStatement != null)
cotMessageWorker.setSqlStatement(cotStatement);
cotMessageWorker.start();
} else { // the listener has started
// there are no errors generated for making multiple resume requests
cotMessageWorker.resumeRequest();
}Ideas? Not really, there's nothing wrong-looking about your code, but maybe I could ask some dumb questions.
Has this code never worked, or does it usually work but occasionally this error occurs? Have you just switched to SQL Server 2005 from 2000 and the error started happening?
Does the table you are inserting to only have those 7 columns, or are there others that are getting default values? Does it contain auto-generated identity columns? Are you sure you're using the right table in the right database?
Maybe you are looking for
-
ITunes 7.0.2 freezes with new iPod 60GB
Hello everyone Everytime I connect my iPod to my Powerbook G4 laptop, iTunes decides to freeze. This never happened to me before. I connect my Nano all the time and no problem. Is there a way to fix this little problem? I checked some sites where use
-
Why can't I get a Skype Number for Canada?
Why can't I get a Skype number for Canada? Post transferred to create its own new thread. Subject/title amended accordingly.
-
Cannot connect clients to LDAP only CardDav
Hi All, I've got a mountain lion server running 10.8.2 and we're recently migrated our OD from a 10.6.8 server. All the users and passwords work fine for file sharing, contacts (via carddav), calendar, and vpn. However, I'd like to some users via LDA
-
Removing file system from meta devices in solaris 10
hi, I have created a file system on meta device in solaris 10 using below command newfs /dev/md/rdsk/d110 now i want to remove file system to make the meta device free, required command to remove file system ? Regards Zeeshan
-
Change Sacle Type in Condition Record
Hi Friends, Is there any way by which we can change the scale type while maintaining the condition records. We have maintained scale type A (Base Scale) in V/06 for a condition type. Now the business requirement is such that we need to maintain two c