on 04-09-2007 3:14 AM
Hi Friends,
In my File to File scenario when ever new mesg is appending to file at receiver side,it should remove <?xml version="1.0" encoding="ISO-8859-1"?> tag from the XML Document.This means <?xml version="1.0" encoding="ISO-8859-1"?> tag should appear once in a document.Plz suggest me to do this.
Thanks
pullarao.
Hey
as pointed out by everyone else,there is no straight way for this,one thing u can do is that create two separate scenarios.
in first scenario use content conversion on receiver side and keep on appending the text to a flat file,now since ur using FCC u wont get <?xml version="1.0" encoding="ISO-8859-1"?>,you will get a flat file on receiver side.
after some time(whatever ur pollin interval is) u can have one more scenario which picks up this flat file and this time use FCC on sender side so that it will convert this flat file to XML,in this way you will get <?xml version="1.0" encoding="ISO-8859-1"?> only once.
hope this solves ur problem.
just make sure that you specify correct polling intervals for both the scenarios.
thanx
ahmad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
you can either use XSLT (with output type="text") or Java, using the code:
...
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(in);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer trans = tf.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
DOMSource source = new DOMSource(doc);
OutputStream out = new ByteArrayOutputStream();
trans.transform(source, new StreamResult(out));
} catch (...
But as Bhavesh said, append mode is not recommended for XML files.
Best approach is collect pattern on BPM.
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
A Valid XML Document will always have this as the first line of your document. There is no way you can create a XML document without this line and even if you do then this is not a valid XML.
Why do you want to do this?
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bhavesh,
In my file to file scenario,i'm appending every new mesg to the XML file.File already have one <?xml> tag and it is valid mesg but the problem is when i was append the new mesg to valid mesg its appending with another <?xml> tag,I need to remove <?xml> tag from every new mesg while appending.
Hi,
The Append Mode in the receiver File Adapter is recommened / should be used only with text files ( i.e when you have Content Conversion in the Receiver File Adapter ).
In your case, as with an XML you are using Append mode, the Final Output file is not a valid XML.
Even if you do remove the first line of the XML document ( using either a module or a java mapping ) , the document will not be a valid XML as the document will not have a ROOT node. You will have to consider using another option other than Append mode on the receievr file adapter .
Regards
Bhavesh
HI,
The same question was already discussed earlier.
See take the file content conversion parameters , i mean conver the file into text file, use the append.Here maintaine the structure to contain multiple rows.
root ---0..unbound
strucutre...
At end of the append time, conver it into XML file and use it for further use.
Or the same file when you are using as input to another scenario use sender side FCC to conver it into xml.
i hoep it is clear.
OR there is an option in BPM, collect all the messages for certain period , at end of period send to file (it may be the xml).
Regards
Chilla
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.