php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72052 DOM truncates XML namespace prefixes to 20 characters
Submitted: 2016-04-18 18:22 UTC Modified: 2017-05-14 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: fg at numlog dot fr Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.6.20 OS: Linux Debian 8.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-04-18 18:22 UTC] fg at numlog dot fr
Description:
------------
First : my PHP version is 5.6.19, but it's not listed above.
When using DOMNode::replaceChild or DOMNode::appendChild or DOMNode::insertBefore in order to insert a node which includes long namespace prefixes (ex. : "variable_trade_item_information:variableTradeItemInformationModule"), the prefix is truncate to 20 characters. In this example it becomes "variable_trade_item_:variableTradeItemInformationModule".

When inserting such a node, DOM also adds in the root tag of the node all the definitions of the prefix used in the node. This bunch of prefix definitions  include the same truncated prefixes.
May be this header is created because the truncated prefixes are not declared (after they have been truncated), as their definitions in the tag itself are not truncated. Ex; : <variable_trade_item_:variableTradeItemInformationModule xmlns:variable_trade_item_information="urn:gs1:gdsn:variable_trade_item_information:xsd:3" ... (snipped) >

Test script:
---------------
Sorry but my test script depends on large XML file...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-02 10:27 UTC] radu dot groza at bitstone dot eu
any updates on this ? having the exact same issue
 [2017-05-02 10:37 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2017-05-02 10:37 UTC] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

https://3v4l.org/pq53Z
 [2017-05-14 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 02:03:33 2022 UTC