Topic Options
#35792 - 04/23/11 08:14 PM xml and address block or addesses
Bryce Offline
OL Guru

Registered: 04/28/10
Posts: 105
Loc: MN
How do you work with addresses within xml? I am unable to find enough info to understand the process.

When the address on the statement is exported as xml, the customer's name and address is shown as one long text object. How does a person parse the information to get Name, address1, address2, city, state, zip? Sometimes the address contains 1 or 2 additional lines. Sometimes the name is made of more than two words or characters, like "I O O F".

When this statement data is exported as a text file, in this case, all fields are of a fixed size so using the address block in this situation is not a problem.

Thank you in advance for your ideas.

Regards

Top
#35799 - 04/26/11 09:43 AM Re: xml and address block or addesses [Re: Bryce]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Bryce,

First of all, this should have been posted in the "PrintShop Mail Design" forum, as this isn't a feature request, but a question on how to use an existing feature.

With that said, I see no reasons why all the information should on one big line. If your XML file was using a structure like this one for example:

Code:
<customers>
  <customer>
    <Name>John</Name>
    <Address1>333 Street</Address1>
    <Address2>PO BOX 999</Address2>
    <Zip>12345</Zip>
  </customer>
  <customer>
    <Name>Chris</Name>
    <Address1>111 Street</Address1>
    <Address2>PO BOX 222</Address2>
    <Zip>67899</Zip>
  </customer>
</customers>


This would work perfectly in PSM, with each "customer" tag being considered a record, and Name, Address1, Address2 and Zip would all be four different fields as opposed to one field with all information. So you really do not need to have everything on one single line, and I think this may have more to do with the software you're using to generate your XML. Check if maybe there is an option to save each address fields as a separate tag rather than everything under one tag.

If it's not possible, the only way you could parse one big line is if there was some characters to separate each items. For example, if you had something like this in your field:

<MyField>John|Address1|Address2|Zip</MyField>

Then in PSM, you could use an expression like this:

REPLACE([Address1], "|", "¶")

By replacing the pipes by the paragraph symbol, all items would then appear on a different line in the text box. However, you must be able to put the pipes in the first place.

So in the end, I believe the issue lies with the way the XML is generated. Try to see if you can generate it in a different way that would work with one of the two methods above.

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre

Top