我有一个自定义XML,我需要使用XSL转换为另一种XML格式.
输入:
<Feed>
<repository>
<item-descriptor name="product">
<property name="id">123</property>
<property name="display">asdf</property>
<property name="attr1">attr1</property>
<property name="attr2">attr2</property>
</item-descriptor>
</repository>
</Feed>
Run Code Online (Sandbox Code Playgroud)
输出:
<Feed>
<Products>
<product>
<id>123</id>
<display>asdf</display>
<attr1>attr1</attr>
<attr2>attr2</attr2>
</product>
</Products>
</Feed>
Run Code Online (Sandbox Code Playgroud)
以下XSL用于获得所需的输出.
XSL:
<xsl:template match="/">
<xsl:apply-templates select="Feed"/>
</xsl:template>
<xsl:template match="Feed">
<Feed>
<Products>
<xsl:apply-templates select="repository/item-descriptor[@name='product']"/>
</Products>
</Feed>
</xsl:template>
<xsl:template match="repository/item-descriptor[@name='product']">
<product>
<xsl:apply-templates select="property"/>
</product>
</xsl:template>
<xsl:template match="property">
<xsl:if test=@name='id'>
<id><xsl:value-of select='.'></id>
</xsl:if> <xsl:if test=@name='display'>
<display><xls:value-of select='.'></display>
<xsl:if test=@name='attr1'>
<attr1><xsl:value-of select='.'></attr1>
</xsl:if>
<xsl:if test=@name='attr2'>
<attr2><xls:value-of select='.'></attr2>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
现在我需要生成以下输出,请帮我修改上面的XSL以获得下面的输出:
<Feed>
<Products>
<product>
<id>123</id>
<display>asdf</display>
<attributes>
<aatr1>attr1</attr1> …Run Code Online (Sandbox Code Playgroud) 我最近将我的iPhone更新到iOS 4.0.1,我不能再使用该设备进行开发了.Xcode在设备上安装应用程序时出现以下错误:
从设备收到"InstallProhibited".
配置文件已正确安装,我可以在iOS更新之前使用该设备进行测试.
有没有人遇到过这个错误?我google了一下但找不到相关的东西.
非常感谢您的建议!
我试图在我的iphone上运行Facebook DemoApp,我得到以下错误(它在模拟器上没有错误)
请帮我
***************************** Build DemoApp of project DemoApp with configuration Debug Ld build/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/armv6/DemoApp normal armv6 cd /Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp setenv IPHONEOS_DEPLOYMENT_TARGET 4.0 setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -L/Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/Debug-iphoneos -F/Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/Debug-iphoneos -filelist /Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/armv6/DemoApp.LinkFileList -dead_strip -fopenmp -miphoneos-version-min=4.0 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/armv6/DemoApp arm-apple-darwin10-gcc-4.2.1: libgomp.spec: No such file or directory Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 Ld build/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/armv7/DemoApp normal armv7 cd /Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp setenv IPHONEOS_DEPLOYMENT_TARGET 4.0 setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -L/Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/Debug-iphoneos -F/Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/Debug-iphoneos -filelist /Users/aumidwilliams/Downloads/facebook-facebook-ios-sdk-57818a0/sample/DemoApp/build/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/armv7/DemoApp.LinkFileList -dead_strip …
我需要帮助使用这些符号⎕,∨,0,Ʌ等.但是当我使用iText创建PDF时,这些符号不会出现.
我能做什么才能出现这些符号?
我将在railstutorial.org上阅读rails 3教程.我刚刚创建了一个非常简单的脚手架用户.
脚手架生成的销毁链接在Internet Explorer中不起作用.它会重定向到show动作,而不是删除用户.
这个问题只发生在IE9和IE8(迄今为止我测试的唯一IE版本)问题不会发生在Firefox中.谁能告诉我为什么会这样?
风景:
<%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %>
Run Code Online (Sandbox Code Playgroud)
生成的HTML:
<a href="/users/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a>
Run Code Online (Sandbox Code Playgroud)
控制器:
def destroy
@user = User.find(params[:id])
@user.destroy
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end
Run Code Online (Sandbox Code Playgroud) 您好我正在处理一个程序,我想添加一个按钮,允许用户将图片从他的计算机加载到图像中
procedure TForm1.btnLoadPicClick(Sender: TObject);
begin
img1.Picture.LoadFromFile( 'test.1');
img1.Stretch := True ;
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码,但它限制了人只能使用该特定图片,我希望他从他的计算机中选择一个谢谢:)
我有这个xml文件:
<Menu>
<item value="boiled">
<image value="boiling1recipe">boiling1.jpg</image>
<recipeImage>png1.png</recipeImage>
<recipeImage>png2.png</recipeImage>
<recipeImage>png3.png</recipeImage>
<recipeImage>png4.png</recipeImage>
</item>
<item value="boiled">
<image value="boiling2recipe">boiling2.jpeg</image>
<recipeImage>png5.png</recipeImage>
<recipeImage>png6.png</recipeImage>
<recipeImage>png7.png</recipeImage>
<recipeImage>png8.png</recipeImage>
</item>
<item value="rosted">
<image value="roasted1recipe">roasted1.jpeg</image>
<recipeImage>png8.png</recipeImage>
<recipeImage>png9.png</recipeImage>
<recipeImage>png10.png</recipeImage>
<recipeImage>png11.png</recipeImage>
</item>
<item value="rosted">
<image value="roasted2recipe">roasted2.jpeg</image>
<recipeImage>png12.png</recipeImage>
<recipeImage>png13.png</recipeImage>
<recipeImage>png1.png</recipeImage>
<recipeImage>png2.png</recipeImage>
</item>
</Menu>
Run Code Online (Sandbox Code Playgroud)
现在,我正在解析它:
DDXMLNode *node = [item attributeForName:@"value"];
if ([[node stringValue] isEqual:@"boiled"]) {
[listOfBoiledItems addObject:model];
DDXMLNode *node1 = [item attributeForName:@"value"];
if ([[node1 stringValue] isEqual:@"boiling1recipe"]) {
[listOfRecipies1 addObject:model];
}
else if ([[node1 stringValue] isEqual:@"boiling2recipe"]) {
[listOfRecipies2 addObject:model];
}
}
else if ([[node stringValue] isEqual:@"rosted"]) …Run Code Online (Sandbox Code Playgroud) $ OPTION="-n" $ echo $OPTION $
什么都没发生.我期待这个.
$ OPTION="-n" $ echo $OPTION -n $
为什么是这样?
我有一个包含64个二进制符号的字符串.
我需要将其转换为十进制数.我怎么能在perl中做到这一点?
sub bin2dec {
return unpack("N", pack("B64", substr("0" x 64 . shift, -64)));
}
Run Code Online (Sandbox Code Playgroud)
不起作用.它只转换前32位.
Javascript是一种功能强大的语言,但是我无法理解为什么有多种方法可以使用OOP,难道你不认为它为新开发人员增加了前沿障碍,而这些开发人员必须更加努力地掌握这些库吗?