任何一个帮助脚本功能错误? [英] any one help script functiod error?

查看:67
本文介绍了任何一个帮助脚本功能错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



hi,


i需要别人的帮助,

i need someone help,


如何删除destation端的重复元素,例如 

how to remove the duplicate elements in the destation side , and like 


requirment,源文件是这样的,

requirment, source file come like this,



< emlpoyees>

 < emp> ab1< emp>

< employees>

<emlpoyees>
  <emp>ab1<emp>
<employees>


< emlpoyees>

 < emp> ab1< emp>

< employees>

<emlpoyees>
  <emp>ab1<emp>
<employees>


< emlpoyees>

<emlpoyees>


 < emp> ab3< emp>

< employees>

  <emp>ab3<emp>
<employees>



但在这里我想根据要求采取输出< emp> ab3< emp>。

but here i want take as per requirment  output take <emp>ab3<emp>.



我尝试使用scrpitfunctiod 使用xslt this,但不能正常工作,

im tried with scrpitfunctiod  using xslt this , but not working,


?xml version =" 1.0" encoding =" utf-8"?>

< xsl:stylesheet version =" 1.0" xmlns:xsl =" http://www.w3.org/1999/XSL/Transform "
xmlns:msxsl =" urn:schemas-microsoft-com:xslt" exclude-result-prefixes =" msxsl">


 < xsl:output omit-xml-declaration = " yes" indent =" yes" />

 < xsl:key name =" group" match =" / rootnode / employees" use =" emp" />

 < xsl:template match =" /">

   < xsl:for-each select =" / rootnode / employees [generate-id()= generate-id(key('group',emp)[1])] ">

     < xsl:if test =" position()= last()"> &
       < xsl:copy-of select ="。" />

     < / xsl:if>

&NBSP;&NBSP;&NBSP; < / xsl:for-each>

  < / xsl:template>

< / xsl:stylesheet>

?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:key name="group" match="/rootnode/employees" use="emp"/>
  <xsl:template match="/">
    <xsl:for-each select="/rootnode/employees[generate-id()=generate-id(key('group', emp)[1])]">
      <xsl:if test="position() = last()">
        <xsl:copy-of select="."/>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>


please any one帮助。

please any one help.


请提供任何样本。

please any provide sample .


即时通讯在内联调用脚本函数调用模板中使用此xslt编码,但得到的错误如,

im using this xslt coding in inline call script functiod call template, but got the error like ,



输出验证错误:  根级别的数据
无效。第3行,第5位。



                  also:  < strong style ="border-top-width:0px;右边框宽度:0像素;边界底部宽度:0像素;左边框宽度:0像素;边框样式family:宋体;边框颜色family:宋体;字体重量:粗体;字体风格:继承; FONT-FAMILY:继承;边距:0像素;概括式family:宋体;轮廓色:初始; padding-bottom:0px">输出
验证错误:缺少根元素。


 在
之后我发现了一些奇怪的错误:   连接到目标节点'emp'的
Scripting functoid在其'Xslt调用模板'定义中有一个错误:'意外的XML声明.XML声明必须是第一个节点在文档中,并且在
之前不允许出现空格字符。第1行,第81位。'



谢谢


推荐答案

hi

你能尝试吗? / rootnote / employees [last()]

Can you try /rootnote/employees[last()]

请参阅
这个
页面有关使用Xpath函数的详细信息

Please see this page for details about using Xpath Functions

HTH

Naushad


这篇关于任何一个帮助脚本功能错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆