使用SISS XML任务编辑器从XML多节点提取文本文件

使用SISS XML任务编辑器从XML多节点提取文本文件,xml,xslt,ssis,Xml,Xslt,Ssis,我尝试从多节点XML源中提取或使用SSI使e XML更易于阐述,但没有成功。 我尝试使用XML任务编辑器进行此解析 从这个XML <?xml version="1.0" encoding="UTF-8"?> <Feed xmlns="http://www.bazaarvoice.com/xs/PRR/SyndicationFeed/14.7" name="ciaotu" extractDate="2018-06-08T00:00:00.000Z"> <Pr

我尝试从多节点XML源中提取或使用SSI使e XML更易于阐述,但没有成功。
我尝试使用XML任务编辑器进行此解析

从这个XML

<?xml version="1.0" encoding="UTF-8"?>
<Feed xmlns="http://www.bazaarvoice.com/xs/PRR/SyndicationFeed/14.7" name="ciaotu" extractDate="2018-06-08T00:00:00.000Z">
    <Product disabled="false" removed="false" id="100002652">
        <ImageUrl>https://images.ciaotu.it/nobrand/0/lightbox/652/100002652/n94103.jpg</ImageUrl>
        <Name>HR 101 Carta Fotografica A3 106 gr / m2 100 Fogli</Name>
        <ExternalId>100002652</ExternalId>
        <Description>HR 101 Carta Fotografica ad Alta Risoluzione Formato A3 106 gr / m2 100 Fogli</Description>
        <Brand disabled="false">
            <ExternalId>2079</ExternalId>
            <Name>CANON</Name>
            <Attributes>
                <Attribute id="NAME">
                    <Value>CANON</Value>
                </Attribute>
            </Attributes>
        </Brand>
        <Source>ciaotu</Source>
        <ProductPageUrl>https://www.ciaotu.it/carta-fotografica-CANON/d-94103</ProductPageUrl>
        <NativeReviewStatistics>
            <AverageOverallRating>5.0</AverageOverallRating>
            <NotRecommendedCount>0</NotRecommendedCount>
            <OverallRatingRange>5</OverallRatingRange>
            <RatingsOnlyReviewCount>0</RatingsOnlyReviewCount>
            <RecommendedCount>1</RecommendedCount>
            <TotalReviewCount>1</TotalReviewCount>
            <AverageRatingValues>
                <AverageRatingValue id="Quality">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="Quality">
                        <ExternalId>Quality</ExternalId>
                        <Label>Qualità</Label>
                        <Label1>Come valuteresti la qualità del prodotto?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
                <AverageRatingValue id="Appearance1">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="Appearance1">
                        <ExternalId>Appearance1</ExternalId>
                        <Label>Aspetto</Label>
                        <Label1>Come valuteresti l'aspetto del prodotto?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
                <AverageRatingValue id="facilitaDuso">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="facilitaDuso">
                        <ExternalId>facilitaDuso</ExternalId>
                        <Label>Facilità d'uso</Label>
                        <Label1>Come valuteresti la facilità d'uso?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
                <AverageRatingValue id="Value">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="Value">
                        <ExternalId>Value</ExternalId>
                        <Label>Rapporto qualità-prezzo</Label>
                        <Label1>Come valuteresti il rapporto qualità-prezzo del prodotto?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
            </AverageRatingValues>
            <RatingDistribution>
                <RatingDistributionItem>
                    <RatingValue>5</RatingValue>
                    <Count>1</Count>
                </RatingDistributionItem>
            </RatingDistribution>
        </NativeReviewStatistics>
        <NumAnswers>0</NumAnswers>
        <NumNativeAnswers>0</NumNativeAnswers>
        <NumNativeQuestions>0</NumNativeQuestions>
        <NumQuestions>0</NumQuestions>
        <NumReviews>1</NumReviews>
        <ProductReviewsUrl>http://c7.ugc.bazaarvoice.com/17950/100002652/reviews.htm</ProductReviewsUrl>
        <ReviewStatistics>
            <AverageOverallRating>5.0</AverageOverallRating>
            <NotRecommendedCount>0</NotRecommendedCount>
            <OverallRatingRange>5</OverallRatingRange>
            <RatingsOnlyReviewCount>0</RatingsOnlyReviewCount>
            <RecommendedCount>1</RecommendedCount>
            <TotalReviewCount>1</TotalReviewCount>
            <AverageRatingValues>
                <AverageRatingValue id="Quality">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="Quality">
                        <ExternalId>Quality</ExternalId>
                        <Label>Qualità</Label>
                        <Label1>Come valuteresti la qualità del prodotto?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
                <AverageRatingValue id="Appearance1">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="Appearance1">
                        <ExternalId>Appearance1</ExternalId>
                        <Label>Aspetto</Label>
                        <Label1>Come valuteresti l'aspetto del prodotto?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
                <AverageRatingValue id="facilitaDuso">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="facilitaDuso">
                        <ExternalId>facilitaDuso</ExternalId>
                        <Label>Facilità d'uso</Label>
                        <Label1>Come valuteresti la facilità d'uso?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
                <AverageRatingValue id="Value">
                    <AverageRating>5.0</AverageRating>
                    <RatingDimension displayType="NORMAL" selectedValueInDisplayEnabled="false" id="Value">
                        <ExternalId>Value</ExternalId>
                        <Label>Rapporto qualità-prezzo</Label>
                        <Label1>Come valuteresti il rapporto qualità-prezzo del prodotto?</Label1>
                        <RatingRange>5</RatingRange>
                    </RatingDimension>
                </AverageRatingValue>
            </AverageRatingValues>
            <RatingDistribution>
                <RatingDistributionItem>
                    <RatingValue>5</RatingValue>
                    <Count>1</Count>
                </RatingDistributionItem>
            </RatingDistribution>
        </ReviewStatistics>
        <CategoryItems>
            <CategoryItem id="6431">
                <ExternalId>6431</ExternalId>
                <CategoryName>Carta Fotografica</CategoryName>
                <CategoryId>1660316</CategoryId>
            </CategoryItem>
            <CategoryItem id="5812">
                <ExternalId>5812</ExternalId>
                <CategoryName>Toner, Cartucce &amp; Consumabili</CategoryName>
                <CategoryId>1634308</CategoryId>
            </CategoryItem>
            <CategoryItem id="5767">
                <ExternalId>5767</ExternalId>
                <CategoryName>Office &amp; Consumabili</CategoryName>
                <CategoryId>1633507</CategoryId>
            </CategoryItem>
        </CategoryItems>
        <EANs>
            <EAN>4960999868554</EAN>
        </EANs>
        <ManufacturerPartNumbers>
            <ManufacturerPartNumber>1033A005AB</ManufacturerPartNumber>
        </ManufacturerPartNumbers>
    </Product>
</Feed>
我尝试了以下多种组合以获得值,但没有任何结果:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
  <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
  <xsl:template match="/">
<xsl:text>ExternalId;averageOverallRating;overallRatingRange;totalReviewCount;ratingsOnlyReviewCount;recommendedCount</xsl:text>
    <xsl:text>&#13;&#10;</xsl:text>
    <xsl:for-each select="Feed/Product/ReviewStatistics">
      <xsl:text>"</xsl:text>
        <xsl:value-of select="../../Product/ExternalId"/>
      <xsl:text>";"</xsl:text>
        <xsl:value-of select="../../../Product/ExternalId"/>
      <xsl:text>";"</xsl:text>
        <xsl:value-of select="../ExternalId"/>
      <xsl:text>"</xsl:text>
      <xsl:text>";"</xsl:text>
        <xsl:value-of select="ExternalId"/>
      <xsl:text>"</xsl:text>
      <xsl:text>&#13;&#10;</xsl:text>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

外部的;平均总体增长率;总体污染范围;总回顾计数;对里列维计数的比率;推荐数量


"
";"
";"
"
";"
"


我的结果总是没有值的头文件…
请告诉我一些事情。

意大利阿伦

尝试添加
xpath默认名称空间=”http://www.bazaarvoice.com/xs/PRR/SyndicationFeed/14.7“
xsl:stylesheet
(假设SISS真的支持xslt2.0。我不熟悉它。)没有任何变化……SSIS是Microsoft产品,几乎可以肯定只支持XSLT 1.0。问题是您的XML在中有一个默认名称空间(The
xmlns=“xmlns=”http://www.bazaarvoice.com...“
在根
Feed
元素上),但您尚未在XSLT中说明该名称空间。有关如何通过将默认名称空间与XSLT 1.0.OK中的前缀关联来处理默认名称空间的示例,请参见。感谢您的XLST,您需要将名称空间前缀定义为
xmlns:my=”http://www.bazaarvoice.com/xs/PRR/SyndicationFeed/14.7“
。名称空间URI必须与XML匹配。您在XSLT中选择的前缀实际上可以是任何内容。
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
  <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
  <xsl:template match="/">
<xsl:text>ExternalId;averageOverallRating;overallRatingRange;totalReviewCount;ratingsOnlyReviewCount;recommendedCount</xsl:text>
    <xsl:text>&#13;&#10;</xsl:text>
    <xsl:for-each select="Feed/Product/ReviewStatistics">
      <xsl:text>"</xsl:text>
        <xsl:value-of select="../../Product/ExternalId"/>
      <xsl:text>";"</xsl:text>
        <xsl:value-of select="../../../Product/ExternalId"/>
      <xsl:text>";"</xsl:text>
        <xsl:value-of select="../ExternalId"/>
      <xsl:text>"</xsl:text>
      <xsl:text>";"</xsl:text>
        <xsl:value-of select="ExternalId"/>
      <xsl:text>"</xsl:text>
      <xsl:text>&#13;&#10;</xsl:text>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>