|
439 | 439 | </xsl:when> |
440 | 440 | <xsl:otherwise> |
441 | 441 | <xsl:apply-templates select="@*|node()[not(self::external)]" /> |
442 | | - <xsl:call-template name="docset-without-builddocs" ></xsl:call-template> |
| 442 | + |
| 443 | + <xsl:if test="external/link[not(starts-with(language/url/@href, 'https://'))]"> |
| 444 | + <xsl:call-template name="docset-without-builddocs" ></xsl:call-template> |
| 445 | + </xsl:if> |
| 446 | + |
| 447 | + <xsl:if test="external/link[starts-with(language/url/@href, 'https://')]"> |
| 448 | + <external> |
| 449 | + <xsl:apply-templates select="external/link[starts-with(language/url/@href, 'https://')]" mode="external-link"/> |
| 450 | + </external> |
| 451 | + </xsl:if> |
443 | 452 | </xsl:otherwise> |
444 | 453 | </xsl:choose> |
445 | 454 | </docset> |
|
476 | 485 |
|
477 | 486 | <xsl:template name="docset-without-builddocs"> |
478 | 487 | <resources> |
479 | | - <xsl:apply-templates select="external" mode="builddocs" /> |
| 488 | + <xsl:apply-templates select="external[link[not(starts-with(language/url/@href, 'https://'))]]" mode="builddocs" /> |
480 | 489 | </resources> |
481 | 490 | </xsl:template> |
482 | 491 |
|
483 | 492 |
|
484 | 493 | <xsl:template match="docset/external" mode="builddocs"> |
485 | 494 | <locale lang="en-us"> |
486 | | - <xsl:apply-templates select="link" mode="builddocs" /> |
| 495 | + <xsl:apply-templates select="link[not(starts-with(language/url/@href, 'https://'))]" mode="builddocs" /> |
487 | 496 | </locale> |
488 | | - <xsl:if test="link[@lang != 'en-us']"> |
| 497 | + <xsl:if test="link[not(starts-with(language/url/@href, 'https://')) and @lang != 'en-us']"> |
489 | 498 | <xsl:message>TODO: Found non-English links in docset/external</xsl:message> |
490 | 499 | </xsl:if> |
491 | 500 | </xsl:template> |
492 | 501 |
|
| 502 | + <xsl:template match="link" mode="external-link"> |
| 503 | + <link> |
| 504 | + <xsl:copy-of select="@category|@gated|@titleformat"/> |
| 505 | + <xsl:for-each select="language/url"> |
| 506 | + <url> |
| 507 | + <xsl:copy-of select="@href|@format"/> |
| 508 | + </url> |
| 509 | + </xsl:for-each> |
| 510 | + |
| 511 | + <descriptions> |
| 512 | + <xsl:for-each select="language"> |
| 513 | + <desc> |
| 514 | + <xsl:attribute name="lang"> |
| 515 | + <xsl:choose> |
| 516 | + <xsl:when test="@lang"><xsl:value-of select="@lang"/></xsl:when> |
| 517 | + <xsl:otherwise>en-us</xsl:otherwise> |
| 518 | + </xsl:choose> |
| 519 | + </xsl:attribute> |
| 520 | + <title><xsl:value-of select="@title"/></title> |
| 521 | + </desc> |
| 522 | + </xsl:for-each> |
| 523 | + </descriptions> |
| 524 | + </link> |
| 525 | + </xsl:template> |
| 526 | + |
493 | 527 | <xsl:template match="link" mode="builddocs"> |
494 | 528 | <deliverable type="prebuilt" category="{@category}"> |
495 | 529 | <xsl:apply-templates mode="builddocs" /> |
|
0 commit comments