XML Parsed Buyer Message text containing Linefeeds barfing my code (1 Viewer)

peskywinnets

Registered User.
Local time
Today, 12:19
Joined
Feb 4, 2014
Messages
576
I'm an Ebay seller & I'm requesting order info from Ebay, sometimes a buyer adds a message which I need to trap.

There's no issue trapping the message (I parse it out the returned Ebay XML. But it seems that if the Buyer message has carriage returns (Line feeds) embedded within his message, I only get the message text content up until the first carriage return. For example, here's his buyer message (all customer details changed!)...

Hi
can you make regular invoice to:

Acme S.r.l.
High St, 2
569017 Proscacco (PI) - Italy
VAT Number: IT0188210506

Thanks...
Ing. Rehilleri Alex


but all that's being stored in Access from the above message is

Hi

I've configured the Access table field (called BuyercheckoutMessage) as long text. I parse the incoming message along these lines (the "O" increments with each order while looping)...

Code:
        BuyercheckoutMessage = objxmldoc.selectSingleNode("//ebay:Order[" & O & "]/ebay:BuyerCheckoutMessage").text

presumably I need to replace any incoming message containing ASCII linefeeds (Carriage returns?) to be something that Access is happy with?
 

Ranman256

Well-known member
Local time
Today, 08:19
Joined
Apr 9, 2015
Messages
4,337
Access can read CRLF , (its 2 characters) the character is: vbCrLf.
 

peskywinnets

Registered User.
Local time
Today, 12:19
Joined
Feb 4, 2014
Messages
576
Thanks,

before I was able to see your reply, I sussed a workaround, this seems to solve my issue...

Code:
        BuyercheckoutMessage = objxmldoc.selectSingleNode("//ebay:Order[" & O & "]/ebay:BuyerCheckoutMessage").text
        BuyercheckoutMessage = Replace(BuyercheckoutMessage, Chr(10), " ")
        BuyercheckoutMessage = Replace(BuyercheckoutMessage, ",", Chr(9))

Basically replacing linefeeds & commas within the buyer message text content.
 
Last edited:

Users who are viewing this thread

Top Bottom