YashChoksi1990 Posted May 29, 2014 Share Posted May 29, 2014 im getting following errors: Warning: DOMDocument::load() [domdocument.load]: Opening and ending tag mismatch: property line 6 and xsl:for-each in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/apartment.xsl, line: 25 in/home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 9Warning: DOMDocument::load() [domdocument.load]: Opening and ending tag mismatch: for-each line 5 and property in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/apartment.xsl, line: 26 in/home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 9Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 14Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: xsltParseStylesheetProcess : empty stylesheet in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 14Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]: No stylesheet associated to this object in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 16Fatal error: Call to a member function saveXML() on a non-object in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 18 the xslt file is as following: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <rentalProperties> <xsl:for-each select="//property[numberofBedrooms>=2]"> <property> <xsl:attribute name="contact"><xsl:value-of select='@contact'/></xsl:attribute> <xsl:value-of select="type"/> <xsl:value-of select="price"/> <address> <xsl:value-of select="concat(address/streetNo,' ',address/street,', ',address/suburb,', ',address/state,', Australia')"/> </address> <numberofBedrooms> <xsl:value-of select="numberofBedrooms" /> </numberofBedrooms> <numberofBathrooms> <xsl:value-of select="numberofBathrooms" /> </numberofBathrooms> <garage> <xsl:value-of select="garage" /> </garage> <description> <xsl:value-of select="description" /> </description> </xsl:for-each> </property> </rentalProperties> </xsl:template> </xsl:stylesheet> Can somebody help me out ? transform1.php rental.xml Quote Link to comment https://forums.phpfreaks.com/topic/288853-errors/ Share on other sites More sharing options...
kicken Posted May 29, 2014 Share Posted May 29, 2014 Your lines: </xsl:for-each> </property> are backwards. You should be closing the property tag before the for-each tag. Quote Link to comment https://forums.phpfreaks.com/topic/288853-errors/#findComment-1481240 Share on other sites More sharing options...
Maq Posted May 29, 2014 Share Posted May 29, 2014 @OP, if you are using a decent editor/IDE it will detect invalid XML and XSL tags. This isn't a PHP question, moving to "other programming languages". Quote Link to comment https://forums.phpfreaks.com/topic/288853-errors/#findComment-1481326 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.