@@ -1495,21 +1495,25 @@ public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?str
1495
1495
$ refentry = $ doc ->createElement ('refentry ' );
1496
1496
$ doc ->appendChild ($ refentry );
1497
1497
1498
- $ id = $ doc ->createAttribute ("xml:id " );
1499
1498
if ($ this ->isMethod ()) {
1500
1499
assert ($ this ->name instanceof MethodName);
1501
1500
/* Namespaces are seperated by '-', '_' must be converted to '-' too.
1502
1501
* Trim away the __ for magic methods */
1503
- $ id-> value = strtolower (
1502
+ $ id = strtolower (
1504
1503
str_replace ('\\' , '- ' , $ this ->name ->className ->__toString ())
1505
1504
. '. '
1506
1505
. str_replace ('_ ' , '- ' , ltrim ($ this ->name ->methodName , '_ ' ))
1507
1506
);
1508
1507
} else {
1509
- $ id ->value = 'function. ' . strtolower (str_replace ('_ ' , '- ' , $ this ->name ->__toString ()));
1510
- }
1511
- $ refentry ->appendChild ($ id );
1512
- $ refentry ->setAttribute ("xmlns " , "http://docbook.org/ns/docbook " );
1508
+ $ id = 'function. ' . strtolower (str_replace ('_ ' , '- ' , $ this ->name ->__toString ()));
1509
+ }
1510
+ $ refentry ->setAttribute ("xml:id " , $ id );
1511
+ /* We create an attribute for xmlns, as libxml otherwise force it to be the first one */
1512
+ //$refentry->setAttribute("xmlns", "http://docbook.org/ns/docbook");
1513
+ $ namespace = $ doc ->createAttribute ('xmlns ' );
1514
+ $ namespace ->value = "http://docbook.org/ns/docbook " ;
1515
+ $ refentry ->setAttributeNode ($ namespace );
1516
+ $ refentry ->setAttribute ("xmlns:xlink " , "http://www.w3.org/1999/xlink " );
1513
1517
$ refentry ->appendChild (new DOMText ("\n " ));
1514
1518
1515
1519
/* Creation of <refnamediv> */
0 commit comments