首页 \ 问答 \ 如何在xslt 1.0中进行模板调用工作(How to make template call work in xslt 1.0)

如何在xslt 1.0中进行模板调用工作(How to make template call work in xslt 1.0)

我有以下模板,我不确定是否正确

<xsl:template match="text()" name="createName">
  <xsl:param name="Type"/>
     <xsl:if test="contains(Type,'NEW')">
       <xsl:value-of select="concat('New','Goal')"/>
     </xsl:if>
    <xsl:if test="contains(Type,'AMD')">
       <xsl:value-of select="concat('Amended','Goal')"/>
     </xsl:if>
</xsl:template>

在这里调用此模板

<xsl:element name="PackageName">
                 <xsl:call-template name="createName">
                     <xsl:with-param name="Type" select="s0:PIXField/s0:TransactionID"/>
                 </xsl:call-template>
              </xsl:element>

s0:PIXField / s0:TransactionID = BPA201605311506452806320060A1AMD

我想创建值为'Amended Goal'的PackageName元素。 但是现在我得到了空的PackageName。 不知道我的代码失败了。 请帮忙。


I have this following template which i am not sure correct or not

<xsl:template match="text()" name="createName">
  <xsl:param name="Type"/>
     <xsl:if test="contains(Type,'NEW')">
       <xsl:value-of select="concat('New','Goal')"/>
     </xsl:if>
    <xsl:if test="contains(Type,'AMD')">
       <xsl:value-of select="concat('Amended','Goal')"/>
     </xsl:if>
</xsl:template>

Calling this template here

<xsl:element name="PackageName">
                 <xsl:call-template name="createName">
                     <xsl:with-param name="Type" select="s0:PIXField/s0:TransactionID"/>
                 </xsl:call-template>
              </xsl:element>

s0:PIXField/s0:TransactionID = BPA201605311506452806320060A1AMD

I want to create PackageName element with value 'Amended Goal'. But for now i am getting empty PackageName. dont know where my code fails. Please help.


原文:https://stackoverflow.com/questions/37730209
更新时间:2022-02-17 12:02

最满意答案

如果您使用预构建的ContactUI,请添加用户,而不是选择要显示的字段,它将遵循Apple的Contact App视图。

你可以做的是以编程方式编写,开发自己的UI来添加联系人。

请按照本教程获取更多信息。 请参见4.1节: 教程


If you are using the pre build ContactUI do add the user, than you can't select what fields to show, It will follow the Apple's Contact App view.

What you can do is make it programatically, develop your own UI to add a contact.

follow this tutorial for more info. See section 4.1: Tutorial

相关问答

更多
  • 使用此补丁: 角ios9-uiwebview.patch.js Use this patch: angular-ios9-uiwebview.patch.js
  • 我认为这是新旧字体旧金山(字体比Helvetica大)和.xib文件的问题。 它可以通过在显示前更改UIDatePicker模式进行修改,然后将其更改回所需的模式: [myDatePicker setDatePickerMode:UIDatePickerModeDateAndTime]; [myDatePicker setDatePickerMode:UIDatePickerModeDate]; 也尝试以编程方式添加DatePicker。 我认为它是一个新的字体在iOS 9中的错误。 I think th ...
  • 我遇到了同样的问题:通过GIDSignIn登录谷歌非常适合 但是对于iOS9,一旦允许按下就会打开Google.com页面。 如果我按下此页面上的完成按钮,控制将进入上述方法,错误=错误域= com.google.GIDSignIn代码= -5“用户取消了登录流程。” UserInfo = {NSLocalizedDescription =用户取消了登录流程。} 我研究了一下。 找到两种可能的解决方 白名单登录相关网址 - 谷歌登录崩溃iOS 9试图调用canOpenURL 使用handleurl call ...
  • 如果您使用预构建的ContactUI,请添加用户,而不是选择要显示的字段,它将遵循Apple的Contact App视图。 你可以做的是以编程方式编写,开发自己的UI来添加联系人。 请按照本教程获取更多信息。 请参见4.1节: 教程 If you are using the pre build ContactUI do add the user, than you can't select what fields to show, It will follow the Apple's Contact App ...
  • 这个新产品在WWDC会议“核心位置的新功能”中进行了说明 。 如果您链接到iOS 9,默认值为NO 。 如果您的应用程序在后台使用位置(不显示蓝色状态栏),除了在Info.plist中设置后台模式功能之外,还必须将allowsBackgroundLocationUpdates设置为YES 。 否则位置更新仅在前台传送。 优点在于,您现在可以在同一个应用程序中使用位置管理员进行背景位置更新和其他位置管理器,只能使用前台位置更新。 您也可以将值重置为NO以更改行为。 文档很清楚: 默认情况下,对于与iOS 9. ...
  • 弃权消息说(强调我的): 使用stringByAddingPercentEncodingWithAllowedCharacters(_ :)代替, 它始终使用推荐的UTF-8编码 ,并且对于特定的URL组件或子组件进行编码 ,因为每个URL组件或子组件对于哪些字符有效会有不同的规则。 所以你只需要提供一个足够的NSCharacterSet作为参数。 幸运的是,对于URL,有一个非常方便的类方法称为URLHostAllowedCharacterSet ,您可以使用如下: let encodedHost = u ...
  • 我认为有一些事情可能会导致你的问题。 1)您确定已添加最新的FBSDKCoreKit和FBSDKLoginKit并将这些行添加到swift文件的顶部: import FBSDKCoreKit import FBSDKLoginKit 2)我已经读过这只是模拟器上的一个错误,应该被忽略。 确保您在真实设备上测试此功能。 3)您是否在课程声明的标题中包含了FBSDKLoginButtonDelegate ? 4)我会确保你的info.plist源代码都包含在内并且正确无误。 这是我在我的应用程序中为Faceb ...
  • 我找到了类似的东西。 这个问题的解决方案似乎正在改变这个: win = window.open('', '_blank', 'width=500,height=700'); 这意味着,省略'about:blank',只需将其留空即可。 也适用于codepen上的代码示例。 我不明白为什么,我的编程技巧有限。 但我在一些论坛软件上遇到了同样的问题,并设法确定了这一点。 干杯,托马斯 I found something similar. A solution to the problem seems to b ...
  • 我最终覆盖了layoutSubviews,因为这是一个UIView子类,它现在似乎正在使用此代码 - (void)layoutSubviews { [super layoutSubviews]; static CGSize viewBounds = { 0, 0 }; static CGSize previousViewBounds = { 0, 0 }; [self setNeedsUpdateConstraints]; viewBounds = CGSizeMa ...
  • 在嗅探数据包之后,我们意识到Facebook现在使用Safari Web View,而不是通过App开放,Facebook正在使用Safari上另一个帐户的旧缓存会话。 愚蠢的错误 - 但新的Facebook SDK也很奇怪。 希望这有助于其他人。 After sniffing the packets we realized now that Facebook uses the Safari Web View, instead of opening up via App, Facebook was usin ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)