On Fri, 21 Aug 2026 06:25:01 GMT, Shruthi Acharya <[email protected]> wrote:

>> Incidentally, there are no XML tests in tier1 and tier2 only has 
>> `javax/xml/crypto` and `com/sun/org/apache/xml/internal/security` via 
>> `jdk_security2`.  You likely want `jtreg:javax/xml/jaxp` too.
>
> @gnu-andrew 
> I applied the changes from the following Apache Xalan commit you suggested:
> 
> https://github.com/apache/xalan-java/commit/666e9b9df6f9f4bef281d4547d088bfa67009bad#diff-315ec5a1a41f86fa47ac6e1c53eb71ee0ee293c2dc2ca00acdafe8b4799a43f5
> 
> However, the testcase was still failing after applying the commit. 
> 
> 
> === Transformed Output ===
> <Order DocumentType="0001" DraftOrderFlag="N" EnterpriseCode="XYZ" 
> EntryType="Web" OrderNo="" OrderDate="" SellerOrganizationCode="XYZ" 
> BuyerOrganizationCode="" ReqDeliveryDate="" ReqShipDate="">
>     <OrderLines>
>         <OrderLine OrderedQty="1" PrimeLineNo="1" SubLineNo="1">
>             <Item ItemID="XYZItem10" UnitOfMeasure="EACH" ProductClass="Good" 
> ItemShortDesc="75 compl&eacute;ments premium et app&eacute;tissants au poulet 
> 300 gr" ManufacturerItemDesc="75 compl&eacute;ments premium et 
> app&eacute;tissants au poulet 300 gr"></Item>
>         </OrderLine>
>     </OrderLines>
>     <PersonInfoShipTo Country="US"></PersonInfoShipTo>
>     <PersonInfoBillTo Country="US"></PersonInfoBillTo>
> </Order>
> 
> =========================
> 
> [Fatal Error] :4:110: The entity "eacute" was referenced, but not declared.
> 
> ✗ FAILED: SAXParseException
> Error at line 4, column 110
> Message: The entity "eacute" was referenced, but not declared.
> org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 110; The entity 
> "eacute" was referenced, but not declared.
>         at 
> java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:263)
>         at 
> java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:335)
>         at 
> java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
>         at HTMLEntityParsingTest.main(HTMLEntityParsingTest.java:48)
> 
> 
> Therefore, I made an additional change in **`ToHTMLStream.java`**:
> 
> 
> else if (escapingNotNeeded(ch) && ch >= CharInfo.ASCII_MAX)
> {
>     // Non-ASCII character that is encodable in the output encoding:
>     // write it literally rather than as a named HTML entity (e.g. &eacute;)
>     // so the output remains valid XML when parsed by an XML parser.
>     cleanLength++;
> }
> 
> 
> The above change resolved the issue, and the final patch is provided below.
> 
> 
> === Transformed Output ===
> <Order DocumentType="0001" DraftOrderFlag="N" EnterpriseCode="XYZ" 
> EntryType="Web" OrderNo="" OrderDate="" SellerOrganizationCode="XYZ" 
> BuyerOrganizationCode="" ReqDeliveryDate="" ReqShipDate="">
>     <OrderLines>
>         <OrderLine OrderedQty="1" PrimeLineNo="1" SubL...

@shruacha1234 I see JDK-8387291 is assigned to @JoeWang-Java, did you check 
with him on this? I can't see if it has been worked on already.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31689#issuecomment-5366899861

Reply via email to