Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokenization updates only attribute, not XML element text #68

Open
jondavis-ineight opened this issue Jan 10, 2017 · 3 comments
Open

Tokenization updates only attribute, not XML element text #68

jondavis-ineight opened this issue Jan 10, 2017 · 3 comments

Comments

@jondavis-ineight
Copy link

jondavis-ineight commented Jan 10, 2017

Only attributes can be tokenized, it seems. So if you have something like ..

<MyProperty>myvalue (replace this)</MyProperty>

.. it won't tokenize. Line 80:

    if ($node) {
        try {
            Write-Host "Updating $($key.Attribute) of $($key.KeyName): $($key.Value)"
            $node.($key.Attribute) = $key.Value
        }
        catch {
            Write-Error "Failure while updating $($key.Attribute) of $($key.KeyName): $($key.Value)"
        }
    }

It should test to see if Attribute was specified, and replace the node's InnerText instead if not.

@Symbianx
Copy link

@harshil93 any update on this request?

@harshil93
Copy link
Member

@Symbianx I haven't actively worked on this and currently very busy in my day to day work. Although I am willing to accept pull requests if you want to contribute.

@jd-porter
Copy link

Hi there,
This is possible with the extension as-is! For the example above, you'd specify a KeyName of

/MyProperty/text()

The text() function ensures that you're always selecting the innerText.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants