Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About abartsch

  • Rank
  1. I'm trying to set the height of my iframe according to its content but it didn't work so far. I was googling around and found some hints regarding div height to set to 100% but it could also not help. The content of the iframe is automatically filled by an PHP script which calls an XML translation. The generated HTML contains again a number of divs which are formatted via CSS. Formatting works fine but the height is limited to a default minimum size. Here comes global structure of my HTML page: <body><div id="container"> <div id="header"> </div> <div id="logo"&g
  2. Thanks, boen_robot! We installed the new PHP version 5.4.5 and are going to install the new libxml2 version 2.8.0 soon. Anyway, I found a workaround i.e. now I save the modified XML file first, open the saved XML file and do the transformation finally. Here is the modified code snippet: $xml = new DOMDocument; $xml->formatOutput = true; $xml->load("xml/$hostname.log.xml"); $elements = $xml->getElementsByTagName("*"); foreach($elements as $element) { $type = $element->getAttribute('type'); $title = $element->getAttribute('title'); if($type == 'comment' or
  3. Hello, my following PHP code i.e. the last line causes a segmentation fault from time to time: $xml = new DOMDocument; $xml->formatOutput = true; $xml->load("xml/$hostname.log.xml"); $elements = $xml->getElementsByTagName("*"); foreach($elements as $element) { $type = $element->getAttribute('type'); $title = $element->getAttribute('title'); if($type == 'comment' or $title == 'Installed Packages') { foreach($element->childNodes as $item) { if($item->nodeType == 4) // XML_CDATA_SECTION_NODE { $cdataWrapper = $xml->createElement("wrapper", $item->nodeV
  4. Based on Martin's idea I could solve my problem: $xml = new DOMDocument; $xml->formatOutput = true; $xml->load("xml/$hostname.log.xml"); $elements = $xml->getElementsByTagName("*"); foreach($elements as $element) { foreach($element->childNodes as $item) { if( $item->nodeType == 4 ) // XML_CDATA_SECTION_NODE { $cdataWrapper = $xml->createElement("wrapper", $item->nodeValue); $element->parentNode->appendChild($cdataWrapper); // $item->parentNode->replaceChild($cdataWrapper, $item); } } } $xsl = new DOMDocument; $xsl->load("xml/wrapper.xsl"
  5. Thanks, Martin! I'll try to check this out but it can take a while since I'm a beginner in PHP, too ;-)
  6. I'm calling the XSLT processor using PHP. Maybe, I have some possibilities to manipulate cdata in within PHP call? Here comes the code snipet: $xml = new DOMDocument;$xml->load("xml/$hostname.log.xml");$xsl = new DOMDocument;$xsl->load("xml/results.xsl");$proc = new XSLTProcessor;$proc->importStyleSheet($xsl);print(trim($proc->transformToXML($xml))); Thanks so far!
  7. In case one cannot address cdata separately using XPATH neither with XSLT 1.0 nor with 2.0 maybe you have an idea to modify the cdata within a template. I already tried XSL function like substring-before and substring-after but this does not work for me. PS: Within Perl I would implement a pattern match for "string = string" but how to do this using XSL?
  8. So far I'm using version 1.0 but 2.0 could also be possible to be implemented.
  9. Hi everybody, I'm new to XSLT and face a problem with cdata which is most probably a simple question for you. I have following XML input (which is mandatory): <table title="Installed Packages" separator="=" caption="true" appendix="false"> <![CDATA[Variant Name = APS]]> <![CDATA[b04hlr02a_VD = Z04Y5V641200]]> ...</table> I'd like to address each cdata line separately but I don't know how. The corresponding XSLT part looks like that: <xsl:when test="table[@title='Installed Packages']"> <tr id="trResultOK"> <td style="text-align
  • Create New...