2013-07-25 3 views
0

имобновление XSL файл с XMLStarlet

trying to update xsl file 
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 
     <xsl:output method="xml" indent="yes" doctype-public="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" doctype-system="http://java.sun.com/dtd/web-app_2_3.dtd"/> 
     <xsl:template match="node()|@*"> 
    <xsl:copy> 
     <xsl:apply-templates select="node()|@*"/> 
    </xsl:copy> 
    </xsl:template> 
    <xsl:template match="display-name"> 
    <xsl:copy-of select="."/> 
    <filter> 
     <filter-name>ssoauthagent</filter-name> 
     <filter-class>12234455</filter-class> 
    </filter> 
    <filter-mapping> 
     <filter-name>ssoauthagent</filter-name> 
     <url-pattern>/*</url-pattern> 
     <dispatcher>INCLUDE</dispatcher> 
     <dispatcher>FORWARD</dispatcher> 
     <dispatcher>REQUEST</dispatcher> 
    </filter-mapping> 
    </xsl:template> 
</xsl:stylesheet> 

остроумие XMLStarlet такие, чтобы изменить значение «» XSL: таблица стилей/XSL: шаблон/фильтр/фильтр-класс»в значение„Hello“Давать ниже команды, но это давая ошибки: -

xml ed -O -u "xsl:stylesheet/xsl:template/filter/filter-class" -v "Hello" transformWeb.xsl 
XPath error : Undefined namespace prefix 
xmlXPathCompiledEval: evaluation failed 

Где я положить его неправильно

+0

Пространство имен должно быть определено автоматически с версии 1.2.0; относительный путь (без ведущей косой черты) будет работать только начиная с версии 1.4.0 – npostavs

ответ

0

ли ниже, и был достаточно хорош, чтобы пойти

xml ed -N xsl='http://www.w3.org/1999/XSL/Transform' -u '//xsl:stylesheet/xsl:template/filter/filter-class' -v 'hello' /root/transformWeb.xsl