小编Way*_*ett的帖子

XSLT for-each循环,基于变量的过滤器

我有以下XSLT

<xsl:param name="productsId" select="/macro/productsId" />
<xsl:param name="type" select="/macro/type" /> <!-- value1, value2, value3 -->

<xsl:template match="/">
    <xsl:if test="$productsId > 0">
        <xsl:variable name="products" select="umbraco.library:GetXmlNodeById($productsId)" />
        <div id="carousel-wrap">
          <ul id="carousel">
          <xsl:for-each select="$products/Product [select only Product with attribute value1, value2 or value3 based on /macro/type]">
            <li id="p-{@id}">
              <xsl:variable name="title">
                <xsl:choose>
                  <xsl:when test="string-length(productHeading) > 0">
                    <xsl:value-of select="productHeading" />
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="@nodeName" />
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
              <a href="{umbraco.library:NiceUrl(@id)}">
                <!-- Image -->
                <xsl:if test="productImage > 0">
                  <xsl:variable name="productImage" select="umbraco.library:GetMedia(productImage, 0)" />
                  <img src="/ImageGen.ashx?image={$productImage/umbracoFile}&amp;height=131" />
                </xsl:if> …
Run Code Online (Sandbox Code Playgroud)

xml xslt xpath umbraco

0
推荐指数
1
解决办法
8720
查看次数

持久化到 Mongo 数据库时出现 NumberFormatException

我正在创建一个简单的VO对象,然后尝试将其持久化到 Mongo 数据库中,NumberFormatException最糟糕的是,对象本身没有抛出异常,因为现在我没有设置对象的任何属性,这个异常正在杀死我,我不确定怎么处理。

这是抛出异常的代码片段:

public void testAgenda(){
    ItemVO item = new ItemVO();
    try {
        item.persist();
    } catch (NumberFormatException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        e.getCause();
        e.getMessage();
    }
Run Code Online (Sandbox Code Playgroud)

这是异常跟踪:

java.lang.RuntimeException:java.lang.NumberFormatException:对于输入字符串:“4e3c3da5fbb7d7b41ce9e394”
        在 com.google.code.morphia.mapping.Mapper.updateKeyInfo(Mapper.java:194)
        在 com.google.code.morphia.DatastoreImpl.postSaveOperations(DatastoreImpl.java:742)
        在 com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:645)
        在 com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:685)
        在 com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:679)
        在 com.williamblair.im.research.domain.vo.BaseDocument.persist(BaseDocument.java:68)
        在 com.williamblair.im.research.service.TestListService.testGetResearchAgenda_aroundBody2(TestListService.java:31)
        在 com.williamblair.im.research.service.TestListService$AjcClosure3.run(TestListService.java:1)
        在 org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
        在 com.williamblair.im.research.system.aop.profiling.ProfilingAspect.doProfiling(ProfilingAspect.java:36)
        在 com.williamblair.im.research.service.TestListService.testGetResearchAgenda(TestListService.java:26)
        在 sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)
        在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        在 java.lang.reflect.Method.invoke(Method.java:597)
        在 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        在 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        在 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        在 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        在 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        在 org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
        在 org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
        在 …

java exception morphia

0
推荐指数
1
解决办法
2304
查看次数

如何在jquery中检索兄弟内容?

如何更改"我的数据"的CSS.每当用户点击输入广播时,我的数据应该改变其文本颜色.如何访问它,因为它是id为'b'的输入的兄弟.请告诉我两种方式,父母访问的强文本和sibling.strong文本

<tr>
  <td>
      <input type='radio' id='b' name='option' value="b">
      My data
  </td>
</tr>
Run Code Online (Sandbox Code Playgroud)

css php jquery

0
推荐指数
1
解决办法
53
查看次数

Internet Explorer 错误:“预期标识符”和“预期对象”

您好,当我加载任何 js 文件时,我在 IE 中遇到此错误,我该怎么办?网页错误详情

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET CLR 1.1.4322)
Timestamp: Tue, 1 Mar 2011 18:34:03 UTC


Message: Expected identifier
Line: 26
Char: 21
Code: 0
URI: http://localhost/learning/public/js/general.js


Message: Object expected
Line: 5
Char: 3
Code: 0
URI: http://localhost/learning/public/js/tests.js
Run Code Online (Sandbox Code Playgroud)

javascript internet-explorer

-2
推荐指数
1
解决办法
1万
查看次数

我可以绕过Javascript阻止程序或添加阻止程序

我想说这个

`<script src='http://resources.infolinks.com/js/infolinks_main.js'     
             type='text/javascript'></script>`
Run Code Online (Sandbox Code Playgroud)

我的网站上的脚本,但我想绕过添加阻止程序.如果有人知道如何做到这一点,请告诉我们如何做.

html javascript

-6
推荐指数
1
解决办法
242
查看次数

标签 统计

javascript ×2

css ×1

exception ×1

html ×1

internet-explorer ×1

java ×1

jquery ×1

morphia ×1

php ×1

umbraco ×1

xml ×1

xpath ×1

xslt ×1