Sample code on using PHP and XSLT to transform XMLLots of working codes using PHP are available in the internet for transforming the XML files using XSL. $xsltrans = new DomDocument(); The above sample code will transform the "XML_file.xml" using the stylesheet "XSL_file.xsl". From the code you can see that two DOM objects are created. One is to load the XML file and the other is to load the XSL file. The 'new DomDocument()' is used to create the DOM object. This object has the 'load' method, which is used to load the XML and the XSL file into them. Once this is done a XSLT processor instance is created with the command 'new XsltProcessor()'. The importStylesheet method and the transformToDoc method of this processor instance are used to import the stylesheet and then do the transformation. Then the result is printed out.
|
|
|||
|
||||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.