Skip to main content
Question

Header closing not correct in XML formation

  • December 8, 2014
  • 4 replies
  • 64 views

parashari
Forum|alt.badge.img+2
Hi,

 

I am working with XML creation and I am getting an issue with header closing. The ideal way for XML formation should be:

 

<TTSInput>

 

<TTSActionID>

 

<Dataset>S12</Dataset>

 

</TTSActionID>

 

</TTSINPUT>

 

 

<UPDATEROAD>

 

<ID>7</ID>

 

<FEATURE>ROAD</FEATURE>

 

<SPEED>60</SPEED>

 

</UPDATEROAD>

 

 

<FINALIZE 1111/>

 

</TTSINPUT>

 

 

Blank spaces denote sections of Header, Body and Footer respectively. The Bold and underlined part has issues i.e, </TTSINPUT>. It shoud cget close at the end of the whole XML (after FINALIZE) while it gets closed in the starting when header is getting closed (denoted by crossed).

 

There is just a minute error with it. Can someone help me with that. Thanks (:
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

david_r
Celebrity
  • December 8, 2014
Hi,

 

 

looks like it's a grouping or sequence issue.

 

 

How are you generating the XML? Personally, I prefer the XMLTemplater and a Text File writer, as it gives complete control over every aspect of the result.

 

 

David

takashi
Celebrity
  • December 9, 2014
Hi,

 

 

I guess you are still fighting with the XML document that you posted a few days ago. (https://safecommunity.force.com/CommunityAnswers?id=906a0000000d6NzAAI)

 

Since you were able to remove unnecessary parts from the document, you can also remove "</TTSINPUT>" with the same process.

 

You can then append "<TTSINPUT>" to the end of the text.

 

Simple and effective, although it's low-tech.

 

 

Takashi

parashari
Forum|alt.badge.img+2
  • Author
  • December 9, 2014

@David R. - I am generating XMLs through XMLTemplater. The writer is XML only (User Attribute Type xml_xml). I am getting everything correct but the closing header is creating a problem. Secondly, if I am taking txt file as writer, the sequence is not correct (even if I use FeatureHolder as used earlier in XML writer.)

 

@Takashi - I am dealing with the same WB as you mentioned :P. The comment issue is resolved by usingTester and StringSearcher. The only issue left is that the closing header should be at the last, so as to binf the XML in one.

 

 

I thing there might be a problem with Counter or ModuloCounter I am working with. I tried checking, but couldn't get the fault in the WB ):

takashi
Celebrity
  • December 9, 2014
Just an idea. If you are reading the file for each line using a Text File reader,

 

- if a line contains "</TTSINPUT>", remove it with the StringReplacer,

 

- if a line contains "<FINALIZE*", append "\\n</TTSINPUT>" to the line with the StringConcatenator.