This topic contains 11 replies, has 0 voices, and was last updated by michoel 7 years, 11 months ago.

  • Author
    Posts
  • #1921

    jokell

    I’m coming up with an error when I try to print a packing slip using advanced forms. It doesn’t happen every time, so I suspect that it has something to do with the items I have on my fulfillment. Here is the error code I’m getting:

    Code:
    The template cannot be saved due to the following errors:
    org.xml.sax.SAXParseException; lineNumber: 135; columnNumber: 88; An invalid XML character (Unicode: 0x5) was found in the element content of the document.

    *The template was stored as invalid.
    I’ve tried to google more about this, but all of my searches have led nowhere. Apparently the unicode character 0x5 is an “ENQ” code, but I have no idea how that could be entered into my form?
    This is a cached copy. Click here to see the original post.

  • #1922

    fjannelle

    Good morning,

    Could you paste the code found at line 135 of your template?

    I have seen the ENQ character injected in Addresses and Serial/Lot/Bin Numbers before (to act as a line feed). It usually happens to Addresses when copy/pasting values.

    You could add Freemarker code to replace the character (with a regular line feed) or simply modify the Address of the specific transaction/customer.

    Best regards,

  • #1923

    jokell

    So line 135 of the template is simply this:

    Code:
    border-top: 1px dashed #d3d3d3;
    It’s just part of a CSS style for a horizontal rule. It’s not this code, because it doesn’t happen every time. So far it’s only happened on transfer orders, but again I suspect it’s because of the items that are on them.

  • #1924

    jokell

    I think it happens when an item has a “/” in either the item name or the description. But I haven’t been able to confirm that 100% yet. – Nope, that’s not it

  • #1925

    jokell

    I’ve confirmed it happens on every fulfillment made from a transfer order, and only if the description of the item is included. Here is the code that is supposed to display that:

    Code:

    ${item.item}
    ${item.description} ${item.quantity}

    Any ideas?

  • #1926

    michoel

    Originally posted by jokell

    View Post

    So line 135 of the template is simply this:

    Code:
    border-top: 1px dashed #d3d3d3;
    It’s just part of a CSS style for a horizontal rule. It’s not this code, because it doesn’t happen every time. So far it’s only happened on transfer orders, but again I suspect it’s because of the items that are on them.

    As this is a BFO error, the line numbers won’t match up with your original template as it’s running on generated file that’s been preprocessed by Freemarker

  • #1927

    michoel

    Originally posted by jokell

    View Post

    I’ve confirmed it happens on every fulfillment made from a transfer order, and only if the description of the item is included. Here is the code that is supposed to display that:

    Code:

    ${item.item}
    ${item.description} ${item.quantity}

    Any ideas?

    I’ve actually run into this exact problem, but never got around to looking for a solution. Interestingly, this only occurred on Item Fulfillments that were created from Transfer Orders, but not on Fulfillments with those same products off a regular Sales Order.

    Your post inspired me to give it a shot.

    This should fix the issue:

    Code:
    ${item.description?replace(‘’, ”, ‘r’)}

  • #1928

    jokell

    michoel That worked! Thank you!

  • #1929

    Jochen

    Yep, excellent solution! Only happens from time to time and really really hard to find the invisible character. This fix solves it! Would also be great if the Netsuite XML parser does this on its own – without any help from us customers …

  • #1930

    cr223309

    Hi jokell and all other members of the forum,

    We are getting similar issues to the ones in this post, however, our error message displays:

    The template cannot be saved due to the following errors:

    org.xml.sax.SAXParseException; lineNumber: 286; columnNumber: 111; The prefix “u1” for element “u1” is not bound.

    *The template was stored as invalid.

    We have tried searching the entire form for the “u1” and “u1” and it is not even in the source code of our form. We have also tried looking at line number 286, however our PDF stops at 206, there are no other lines after that.

    Any help would be appreciated as we are completely stuck and have no idea why this error is showing.

    Thanks!

  • #1931

    jokell

    So it’s happening on line 286 of the generated form, which changes based on what data is sent to it (in my case it was a list of items). It is likely that yours is happening in a description block as well. I ended up running into the issue a few more times with different XML characters. I used the following code to fix it:

    Code:
    ${item.description?replace(‘||’, ”, ‘r’)}
    I’m guessing that you didn’t mean to include the smileys and that the element is actually u1xxx. Just use the same replace code and put in the element you’re seeing.

  • #1932

    michoel

    To expand on what jokell is saying, Advanced PDF/HTML Templates are run through two engines to generate the final PDF file. First they are passed into Freemarker which replaces the template code with the actual record values, and then they go through the BFO library which converts the XML markup into a PDF file. If you receive an error during that second stage, the line number will not correspond to your source file line, but rather to the output from the Freemarker step.

You must be logged in to reply to this topic.