XML output - all tags in Single line?
Hi,
Scenario: HTTP----> XI --- > File(XML)/Proxy(abap).
Output XML file has the data in single line(all XML tags).
Now, issue with abap proxy which reads this XML file for sending attachment in email has length constraint(can not read if line length exceeds 255 chars).
Is there any option in XI, to print each pair of tags in each line(using carriage return or line feed?)
Please help.
Mallik,
I do not think that this can be achieved in XML to XML (unless you can create a specific module and add to the module tab)
But if you create say a CSV or TXT file and use the <b>Content Conversion Parameters</b> option
Here you can specify the fieldSeparator to be 'nl'
<b>Input</b>
<?xml version="1.0" encoding="UTF-8"?>
<record>
<field1>f1</field1>
<field2>f2</field2>
<field3>f3</field3>
</record>
<b>Output</b>
f1
f2
f3
Here you have retained your data and each field is separated by a new line. Unfortunatley with this method you lose your XML tags
Regards,
Mike
Similar Messages
-
Can we have a multiple TAGS in single line.Pls let me know
Hi Team,
Can we have a multiple TAGS in single line.Ie 2 open tags and 2 close tags in XML..Pls let me knowchk this xml file
<ns0:Test1>
<Address><street>LinkinPark</street><city>Paris</city></Address>
</ns0:Test1>
But I am not sure whether u can have any value for parent node in 7.0 for like node Address... only child nodes can have value..
It can be done in 7.1
Regards,
Syed -
Xml file read in a single line
HI All,
I have configured a scenario FILE-FILE to generate a XML file as output(input also xml file). It has created xml file successfully, and this file is transferred from ECC5.0 to 4.7. In 4.7 this xml file is read by a particular program in which it is reading the entire file as a single line. This means that its not detecting end of line.
How can I resolve this??
Plz suggest.
rgds,
anilHi Satish,
If I understand, the program needs to read an xml file as a single line. If so, look at Michal weblog /people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
With this simple xslt program you can put a whole xml file into a string. If you also need the inverse, string to xml, looks at the Henrique Pinto reply on bottom of weblog
To use XSLT programs you have 2 options:
XSLT-ABAP Engine -> /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
Or you can paste the xslt code in a txt file, zip the file and import it to XI as Imported Archives.
Hope it helps you
Ricardo.
Message was edited by: Ricardo Quintino -
Xml output remove tag begin with LIST_
Hi,
I have a requirement to generate a report with XML output. This output will be used for upload informations to other application. I know names of all tags and I can't have other tags.
I have a xml file for bi publisher and work fine but group element added one more tag who begin with LIST_.
e.g.
<LIST_mygroup_name>
<mygroup_name>
</mygroup_name>
</LIST_mygroup_name>
I want to remove all tags which begin with LIST_.
Any suggestion?
Thanks
Kale.In reports6i I can you can click on the report properties of the group to remove the list tag.
In data templates just add the property
<property name="include_rowsettag" value="false"/>Don't forget to give me the points!
Ike Wiggins
http://bipublisher.blogspot.com -
JSP Shell Script Output (All At Once Vs Line By Line)
I have no problem calling a shell script and then displaying that output on a web page.
However, I would like to display the output as the script executes (I want to print the output line by line as it happens), rather than waiting for the script to completely finish and then display the whole output all at once. The script checks a large database and takes about 10 minutes to run. I don't want to stare at a blank screen during that time, but of course want to watch it's progress on the display (when I run the script directly I print out status to the screen).
Can someone point me in the right direction on how to do this?
-jsaspoBump...
Anyone? -
Trouble outputting digital waveform to single line
i want to output to a single digital line a digital pulse. my current attempt is to generate a digital waveform and then provide this as data to a digital line output. the vi runs, and the waveform appears as i want, but the digital line doesn't output anything? any help would be greatly appreciated!
Attachments:
digital pulse out.vi 32 KBHi
In reference to my previous post, you can just leave the inner for-loop, but you have to extract the 4 channels.
Just have a look at the picture.
Hope this helps.
Thomas
Using LV8.0
Don't be afraid to rate a good answer...
Attachments:
DigitalWaveform.png 6 KB -
How can I output 01001001 on a single line?
Hello,
I am trying to output a binary address on a single channel using a USB6363 DAQ. I have tried using DAQmx, arrays, I looked at the examples, and I probably just am too new to Labview to understand how to adjust the examples for my use. I attached the code I am currently working with, but any suggestions on how to achieve this would be incredibly appreciated.
Thank you!
Attachments:
Address output.vi 12 KBYou want to perform a Digital Output, Single Channel, Multiple Samples DAQmx Write. This will allow you to specify the array. I don't have LabVIEW with me at the moment, so I can't see what you've done so far.
Try and check out this example I made which explains how to generate these types of digital signals with a DAQ device.
https://decibel.ni.com/content/docs/DOC-19277
This uses a similar implementation as well:
https://decibel.ni.com/content/docs/DOC-22938
You'll see on the document page an example of the kind of DAQmx task you need to configure.
Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD) -
Mercator xml single line translation
hi guys,
I have a map that reads in an xml file and outputs an edifact msg.
When the xml is formatted, i.e spaced apart according to the tags, the map performs fine.
Unfortunately, my xml file is generated by another application that outputs the xml all on one single line.
i.e
<line1>A</line1><line2>B</line2><line3>C</line3>when i run the input file (single line xml) through the map, i get an invalid input message!!
I've already removed all the <cr> and <nl> from all the Terminators in my input type tree, but i still get an Invalid input error message. has anyone experianced this before?
Any help or suggestions are greatly appreciated.Mallik,
I do not think that this can be achieved in XML to XML (unless you can create a specific module and add to the module tab)
But if you create say a CSV or TXT file and use the <b>Content Conversion Parameters</b> option
Here you can specify the fieldSeparator to be 'nl'
<b>Input</b>
<?xml version="1.0" encoding="UTF-8"?>
<record>
<field1>f1</field1>
<field2>f2</field2>
<field3>f3</field3>
</record>
<b>Output</b>
f1
f2
f3
Here you have retained your data and each field is separated by a new line. Unfortunatley with this method you lose your XML tags
Regards,
Mike -
PBDOM : Exporting to XML file gives a single line
I've been starting developing with PowerBuilder 12.5 a few weeks ago. I had to write some XML files, so I got familiar with the PBDOM library.
I can build a lot of different things, it's very nice, but one thing still bothers me :
In the output file, the whole XML is written on a single line.
I use the SaveDocument function.
For example, here is some code :
PBDOM_Document doc
PBDOM_Element noderoot, node1, node11, node12
doc = CREATE PBDOM_Document
doc.NewDocument("NodeRoot")
noderoot = doc.GetRootElement()
node1 = CREATE PBDOM_Element
node1.SetName("Node1")
noderoot.AddContent(node1)
node1.SetAttribute("Attr", "AttrValue")
node11 = CREATE PBDOM_Element
node11.SetName("Node11")
node11.AddContent("Here is a value")
node1.AddContent(node11)
node12 = CREATE PBDOM_ELEMENT
node12.SetName("Node12")
node12.AddContent("Here is another value")
node1.AddContent(node12)
doc.SaveDocument("myDoc.xml")
Here is the result when I open it with notepad++
<NodeRoot><Node1 Attr="AttrValue"><Node11>Here is a value</Node11><Node12>Here is another value</Node12></Node1></NodeRoot>
Whereas I wanted :
<NodeRoot> <Node1 Attr="AttrValue"> <Node11>Here is a value</Node11> <Node12>Here is another value</Node12> </Node1> </NodeRoot>
With the notepad++ XML tools plugin, I can use the "pretty print" function to get this nice representation. But I would like my file to be formatted this way from the beginning. I noticed that the "line ending" was set to UNIX format (indicator on bottom right of the window), but I'm working on Windows. When I use the menu to convert it to Windows format (CR+LF), it changes this indicator, but the code stays on one single line.
Is there a way to tell PBDOM to export the XML file with a nice output ?
Thank you !
Notes :
- Opening the XML file with Internet Explorer or Google Chrome gives me a nice vizualisation, with indentation, line breaks...
- Adding a <?xml version="1.0" encoding="ISO-8859-1" ?> does not help (I've been doing it while exporting some more complex files, but I still get the output on one line...)Here is a very simple powerbuilder example. It uses MSXML instead of PBDOM. See my comments for hints how to use it with PBDOM.
oleobject lole_dom, lole_root, lole_element1, lole_element11, lole_element12
oleobject lole_Writer, lole_saxreader
string ls_result
// build DOM (you don't need this if you use PBDOM)
lole_dom = create oleobject
lole_dom.ConnectToNewObject ("Msxml2.DOMDocument")
lole_root = lole_dom.CreateElement ("NodeRoot")
lole_dom.documentElement = lole_root
lole_element1 = lole_dom.CreateElement("Node1")
lole_root.AppendChild(lole_element1)
lole_element1.SetAttribute("Attr", "AttrValue")
lole_element11 = lole_dom.CreateElement("Node11")
lole_element11.AppendChild (lole_dom.CreateTextNode("Here is a value"))
lole_element1.AppendChild(lole_element11)
lole_element12 = lole_dom.CreateElement("Node12")
lole_element12.AppendChild (lole_dom.CreateTextNode("Here is another value"))
lole_element1.AppendChild(lole_element12)
// this saves the DOM without formatting
//lole_dom.save ("d:\testxml.xml")
// this part is for formating
lole_Writer = create oleobject
lole_saxreader = create oleobject
lole_Writer.ConnectToNewObject ("MSXML2.MXXMLWriter")
lole_saxreader.ConnectToNewObject ("MSXML2.SAXXMLReader")
lole_Writer.omitXMLDeclaration = True
lole_Writer.indent = True
lole_saxreader.contentHandler = lole_Writer
// instead of DOM you can also put a XML string to parser: lole_saxreader.parse ("<node>...</node>")
// so you can also use the PBDOM output directly
lole_saxreader.parse (lole_dom)
// here is your formatted output
ls_Result = lole_Writer.output
MessageBox ("", ls_result)
lole_writer.Disconnectobject( )
lole_saxreader.Disconnectobject( )
lole_dom.Disconnectobject( )
DESTROY lole_writer
DESTROY lole_saxreader
DESTROY lole_dom -
MessageTransformBean - SimplePlain2XML - Multiple records on a single line
Hi,
I am trying to convert multiple record from a single line to multipe rows in an XML message with the MessageTransformBean.
If the record look like this it's working:
RECORD1textETC
RECORD2textETC
But the incoming message are all on a single line:
RECORD1textETCRECORD2textETC
Is there a way to add a linefeed to my incoming message after X characters, or to tell the adapter to split by length instead of spliting on the end of line?
Thanks,
MartinI had to code a custom Module Adapter to do it.
Here's the main part of the module adapter EOLConvertBean...
Message msg = (Message) inputModuleData.getPrincipalData();
XMLPayload xmlpayload = msg.getDocument();
byte[] content = xmlpayload.getContent();
byte crlf = 0x0A; // end of line char
int current = 0; // current bytes read
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int lines = content.length / recordLen; // record len = insert EOL after X recordLen
// TODO change for do while for 1x line record
for (int i = 0; i <= lines; i++) {
baos.write(content, current, recordLen);
baos.write(crlf);
current += recordLen;
xmlpayload.setContent(baos.toByteArray());
inputModuleData.setPrincipalData(msg);
Edited by: Martin Lavoie Rousseau on Oct 6, 2010 9:08 PM -
Converting a single line in Input file
Hi Experts,
I tried searching the blogs and wiki in sdn. but couldnt able to find out.
Can anyone help in providing the blog for converting the input xml file which is provided only in one line.
and the output has to be according to the xml format ( every tag in different line ).
Thanks in advance
DivyaHi Experts,
I tried searching the blogs and wiki in sdn. but couldnt able to find out.
Can anyone help in providing the blog for converting the input xml file which is provided only in one line.
and the output has to be according to the xml format ( every tag in different line ).
Thanks in advance
Divya -
hi I am having problem in formatting XML file which I generated with xmlelement() when I execute it gives me putput in a single line
is there any way that I got my output as a XML file HAS......That is expected behavior. PRETTY print(ing) is only needed for humans. XML Parsers don't need the XML to be pretty printed. If you open the XML file in a browser like Windows Explorer or Firefox, the browser will pretty print the output for you.
In all, the "single line" output is done because of PERFORMANCE reasons (lack of unneeded end of line and CTRL line breaks etc)
SELECT xmlelement("Employee Name", dummy) as "XML RESULT"
FROM DUAL;
<Employee Name>X</Employee Name>
SELECT xmlelement("Employee Name", xmlelement("SurName", dummy)
, xmlelement("LastName", dummy)
) as "XML RESULT"
FROM DUAL;
<Employee Name><SurName>X</SurName><LastName>X</LastName></Employee Name>
XMLSERIALIZE can pretty print the output if needed via INDENTation
SELECT XMLSERIALIZE(CONTENT xmlelement("Employee Name", xmlelement("SurName", dummy), xmlelement("LastName", dummy)) as CLOB indent SIZE=1 )
FROM DUAL;
<Employee Name>
<SurName>X</SurName>
<LastName>X</LastName>
</Employee Name> -
XML output with multiple tags in one line
I have not done much XML exporting with SQL. Previously I had just been ending my SQL queries with
FOR XML RAW ('Company'), ROOT ('Companies'), ELEMENTS;
and it formatted my query nicely in an XML output. That put every column name as a tag and the cell data within the tag.
However, now the criteria has changed on me. I need to create a tag with multiple sub tags in it.
Example: <Location Floor="10" Suite="512" DoorType="Metal">
But I'll still need other tags to be normal in the XML output such as
<Address>123 Fake St</Address>
<City>Springfield</City>
<Location Floor="10" Suite="512" DoorType="Metal">
Is there any way to get this XML mixed in the output like above?
Thank you for any help.Hi, you can FOR XML PATH for a finer degree of control over your XML. Use the @ symbol to create attributes. Here's a simple example:
DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
INSERT INTO @t VALUES
( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
SELECT
[address] AS "Address",
city AS City,
[floor] AS "Location/@Floor",
suite AS "Location/@Suite",
doorType AS "Location/@DoorType"
FROM @t
FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS; -
Output the element in a single line
Hi all,
I encontered a problem when using castor xml tool to gengerate an xml file.
The parser that I an using is org.exolab.castor.parser=org.apache.xerces.parsers.SAXParser.
And I set org.exolab.castor.indent=true in the castor.properties
I got the following ouput:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE subscribers PUBLIC "...
"subscriber.dtd">
<subscribers provider="..."/>
<user name="..."
pass="..."/>
</subscribers>
What I expect is that the user element should be in a single line like following:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE subscribers PUBLIC "..." "subscriber.dtd">
<subscribers provider="..."/>
<user name="..." pass="..."/>
</subscribers>
What should I do to achieve this goal?
I found there is a property which might be useful, but I don't know exactely how to use it:
org.exolab.castor.features=
thanks in advanceHello,
I've found a solution:
We can use our own Serializer to control the output format:
In the castor.properities,
by default org.exolab.castor.serializer=org.apache.xml.serialize.XMLSerializer
I deprived this class and overrided all the constructors and the setOutputFormat method:
public void setOutputFormat(OutputFormat arg0) {
arg0.setIndenting(true);
arg0.setLineWidth(0);
super.setOutputFormat(arg0);
and it works fine
Thanks anyway
Message was edited by:
laseine -
Display spool output i.e a single row in a single line
hello All,
I have report that outputs many columns is single row , when run in the background.
The problem that I am facing that the the single row of columns is wrapped into second line when certain limit of chararcters is reached. That is the single row of data is placed into two lines.
While running the job in the background I choose the LOCL or LP01 printer with format X_65_255.
Also note that I have other SAP systems but in that systems when I use the same procedure(printer and format also the same) for the same report the outputf for single row is not warpped into 2 lines but appears in the same line.
Please provide your input. Points will be rewrded for helpful answers
regards
SachinNote that this solution is for downloading wide formats only - not printing...
Here is what I did:
To create format Y_1024_1023 (New name!)
1) Transaction SPAD
2) Click "Full Administration" button
3) Click on "Device Types" tab
4) Click "Display" button next to "Format Types" field
5) Place cursor on X_65_255
6) Click in menu Format --> Create using template (F5)
7) Change Number of rows to 1023 (if set to 65, you will have more pages and hence more headers)
9) Change Number of Columns to 1023 (as wide as can be displayed in SP01)
8)Give new name to format e.g. Y_1023_1023
To create spool device YSPOOL:
1) Transaction SPAD
2) Click on "Device/Servers" tab (first tab!)
3) Click 'Display" button next to Output Devices field
4) Click "Create" button (Shift-F1)
5) Give output device long name (e.g.YSPOOL) and short name (e.g.YSPO)
6) Device attributes tab --> Device type = ASCIIPRI (Some generic ASCII printer) - I actually used a ZU_ASCII created in our system but ASCIIPRI should also work.
7) Access method tab --> Host printer = some value (e.g. outfile2)
8) Save
Now assign Y_1024_1023 to Device type:
1) Transaction SPAD
2) Click on Device types tab
3) Enter "ASCIIPRI" in "Device types" field and click display button
4) Click on "Formats" button (F6)
5) Click on "Create' button (Shift-F1)
6) In popup, type Y_1023_1023 (or use drop-down to choose from)
7) Save
Per OSS Note 186603 --> Call SPAD and choose Settings -> Spool System -> Other. Select 'SP01: Number of Lines for List Display from Format'. You may have to clear cache via SPAD->Goto->Cache control -->Click "Reset Cache Settings".
Now, when you schedule your background job, choose YSPOOL as your output device and choose the format as Y_1024_1023. The spool generated from this job will be 1023 columns wide and 1024 lines long (less headers!). Note that opening such a large spool (long & wide) will consume lots of app server memory so exit out as soon as download to presentation server is complete.
Maybe you are looking for
-
anyone help me pls.
-
Lens Corrections unavailable in Adobe Camera Raw 8.3
hello, since i switched to photoshop CC (mac version), i am having constant problems with lens corrections in ACR 8.3. i am a professional photographer and i use various canon pro lenses that all exist as unique lens profiles already in photoshop and
-
I bet you can't fix this problem!
I keep typing this question but no one can answer it. I own a MXL-USB condenser mic. I plug it in thn select it as my device in audio prefrences under the core audio tab. As soon as I apply the changes I lose a all audio in logic only. I can still re
-
So I've had my Twist for a few months now, and I've noticed that it gets kinda hot every once in a while. So I installed the Open Hardware Monitor to monitor its temperature. Are these normal/healthy temperatures? Casual use (web browsing, word proce
-
I edited some video last night, but when i opened Premiere Pro CC this morning, the video will not show in the preview window. Sound is working fine. Preview is set to show preview of the timeline. Everything is in the right place on the time line. I