XML Namespaces and How They Affect XPath and XSLT

ref:http://msdn.microsoft.com/en-us/library/ms950779.aspx

 

How to use xpath to query the doc, also including namespace.

 ExpandedBlockStart.gif代码

<? xml version="1.0" encoding="utf-8" ?>
< TestSite  xmlns ="http://schemas.microsoft.com/windows/ProtocolsTest/2007/07/TestConfig"  xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation ="http://schemas.microsoft.com/windows/ProtocolsTest/2007/07/TestConfig http://schemas.microsoft.com/windows/ProtocolsTest/2007/07/TestConfig.xsd" >
  
< Properties >
    
<!-- Angelo  -->
    
<!-- Only Add your change list here! -->
       
< Property  name ="Path.DataSourceReference.SchemaVersion200310"  value ="Report\DataSources\DataSource\DataSourceReference"   />
    
< Property  name ="Path.DataSets.SchemaVersion200310"  value ="Report\DataSets"   />
    
< Property  name ="Path.DataSet.SchemaVersion200310"  value ="Report\DataSets\DataSet"   />
    
< Property  name ="Path.Fields.SchemaVersion200310"  value ="Report\DataSets\DataSet\Fields"   />
    
< Property  name ="Path.Field.SchemaVersion200310"  value ="Report\DataSets\DataSet\Fields\Field"   />
    
< Property  name ="Path.DataField.SchemaVersion200310"  value ="Report\DataSets\DataSet\Fields\Field\DataField"   />
    
< Property  name ="Path.Value.SchemaVersion200310"  value ="Report\DataSets\DataSet\Fields\Field\Value"   />
    
< Property  name ="Path.Query.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query"   />
    
< Property  name ="Path.DataSourceName.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query\DataSourceName"   />
    
< Property  name ="Path.CommandType.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query\CommandType"   />
    
< Property  name ="Path.CommandText.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query\CommandText"   />
    
< Property  name ="Path.QueryParameters.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query\QueryParameters"   />
    
< Property  name ="Path.QueryParameter.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query\QueryParameters\QueryParameter"   />
    
< Property  name ="Path.Timeout.SchemaVersion200310"  value ="Report\DataSets\DataSet\Query\Timeout"   />
    
< Property  name ="Path.CaseSensitivity.SchemaVersion200310"  value ="Report\DataSets\DataSet\CaseSensitivity"   />
    
< Property  name ="Path.Collation.SchemaVersion200310"  value ="Report\DataSets\DataSet\Collation"   />
    
< Property  name ="Path.AccentSensitivity.SchemaVersion200310"  value ="Report\DataSets\DataSet\AccentSensitivity"   />
    
< Property  name ="Path.KanatypeSensitivity.SchemaVersion200310"  value ="Report\DataSets\DataSet\KanatypeSensitivity"   />
    
< Property  name ="Path.WidthSensitivity.SchemaVersion200310"  value ="Report\DataSets\DataSet\WidthSensitivity"   />
    
< Property  name ="Path.Filters.SchemaVersion200310"  value ="Report\DataSets\DataSet\Filters"   />
    
< Property  name ="Path.Filter.SchemaVersion200310"  value ="Report\DataSets\DataSet\Filters\Filter"   />
    
< Property  name ="Path.FilterExpression.SchemaVersion200310"  value ="Report\DataSets\DataSet\Filters\Filter\FilterExpression"   />
    
< Property  name ="Path.Operator.SchemaVersion200310"  value ="Report\DataSets\DataSet\Filters\Filter\Operator"   />
    
< Property  name ="Path.FilterValues.SchemaVersion200310"  value ="Report\DataSets\DataSet\Filters\Filter\FilterValues"   />
    
< Property  name ="Path.FilterValue.SchemaVersion200310"  value ="Report\DataSets\DataSet\Filters\Filter\FilterValues\FilterValue"   />
    
< Property  name ="Path.Body.SchemaVersion200310"  value ="Report\Body"   />
    
< Property  name ="Path.ReportItems.SchemaVersion200310"  value ="Report\Body\ReportItems"   />
    
< Property  name ="Path.Line.SchemaVersion200310"  value ="Report\Body\ReportItems\Line"   />
    
< Property  name ="Path.Style.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style"   />
    
< Property  name ="Path.BorderColor.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderColor"   />
    
< Property  name ="Path.Default.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderColor\Default"   />
    
< Property  name ="Path.Left.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderColor\Left"   />
    
< Property  name ="Path.Right.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderColor\Right"   />
    
< Property  name ="Path.Top.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderColor\Top"   />
    
< Property  name ="Path.Bottom.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderColor\Bottom"   />
    
< Property  name ="Path.BorderStyle.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderStyle"   />
    
< Property  name ="Path.BorderWidth.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BorderWidth"   />
    
< Property  name ="Path.BackgroundColor.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundColor"   />
    
< Property  name ="Path.BackgroundGradientType.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundGradientType"   />
    
< Property  name ="Path.BackgroundGradientEndColor.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundGradientEndColor"   />
    
< Property  name ="Path.BackgroundImage.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundImage"   />
    
< Property  name ="Path.Source.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundImage\Source"   />
    
< Property  name ="Path.MIMEType.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundImage\MIMEType"   />
    
< Property  name ="Path.BackgroundRepeat.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\BackgroundImage\BackgroundRepeat"   />
    
< Property  name ="Path.FontStyle.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\FontStyle"   />
    
< Property  name ="Path.FontFamily.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\FontFamily"   />
    
< Property  name ="Path.FontSize.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\FontSize"   />
    
< Property  name ="Path.FontWeight.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\FontWeight"   />
    
< Property  name ="Path.Format.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\Format"   />
    
< Property  name ="Path.TextDecoration.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\TextDecoration"   />
    
< Property  name ="Path.TextAlign.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\TextAlign"   />
    
< Property  name ="Path.VerticalAlign.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\VerticalAlign"   />
    
< Property  name ="Path.Color.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\Color"   />
    
< Property  name ="Path.PaddingLeft.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\PaddingLeft"   />
    
< Property  name ="Path.PaddingRight.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\PaddingRight"   />
    
< Property  name ="Path.PaddingTop.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\PaddingTop"   />
    
< Property  name ="Path.PaddingBottom.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\PaddingBottom"   />
    
< Property  name ="Path.LineHeight.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\LineHeight"   />
    
< Property  name ="Path.Direction.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\Direction"   />
    
< Property  name ="Path.WritingMode.SchemaVersion200310"  value ="Report\Body\ReportItems\Line\Style\WritingMode"   />
    
  
</ Properties >
</ TestSite >

 

 

Always failed when there the namespace existing.

 

 

转载于:https://www.cnblogs.com/BpLoveGcy/archive/2010/05/26/1744357.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值