Leser: 2
5 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="var" select="document('xxx.xml')/xxxx/xxxx"/>
<xsl:template match="tag1">
<tag1>
<xsl:attribute name="attr1">
<xsl:value-of select="$var" />
</xsl:attribute>
</tag1>
</xsl:template>
</xsl:stylesheet>
1 2 3 4 5 6 7 8 9 10 11 12 13 14
use XML::LibXSLT; use XML::LibXML; my ($style_file, @source_files) = @ARGV; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $stylesheet = $xslt->parse_stylesheet_file($style_file); foreach my $source_file (@source_files) { my $source_doc = $parser->parse_file($source_file); my $result = $stylesheet->transform($source_doc); print $stylesheet->output_string($result); }
5 Einträge, 1 Seite |