1

image description here

As in the picture the address line 1 is in two lines within the field Address Line-1.

Example, this is how it is now:

Address Line 1: 1234 California street

                   APT 555

When I convert this data into XML its splitting the address into two lines. How to bring this address into single line in XSLT ?

After applying XSLT I want this into single line as following

Column/Field Name as Address Line-1

Address as 1234 California street APT 555

2
  • 1
    Your question is not clear. Please review the help on how to ask. Commented Apr 19, 2017 at 23:53
  • Provide an example of the XML that you are transforming, and an example of the desired output. Chances are that you want to use normalize-space() to collapse the carriage return(s) and whitespace. Commented Apr 20, 2017 at 4:08

1 Answer 1

0

I seems that your source XML has the address split into 2 lines, maybe with some spaces at the beginning of the 2nd line, something like this:

<address>1234 California street
    APT 555</address>

So if you either apply an identity template to such a tag or use <xsl:value-of select="address"/>, the resulting text will also be divided into 2 lines, keeping leading spaces in the 2nd line.

Probably you should use <xsl:value-of select="normalize-space(address)"/>.

Normalize-space function will likely do the job, converting a sequence of internal "white" chars into a single space.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.