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

Support removal of elements based on a file containing a list of XPaths #203

Open
pcon opened this issue Oct 28, 2015 · 1 comment
Open

Comments

@pcon
Copy link
Member

pcon commented Oct 28, 2015

For example, if we have the following object named Admin.profile

<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
    <!-- Lots more data goes here -->
    <userPermissions>
        <enabled>true</enabled>
        <name>MergeTopics</name>
    </userPermissions>
    <userPermissions>
        <enabled>true</enabled>
        <name>ModerateChatter</name>
    </userPermissions>
    <userPermissions>
        <enabled>true</enabled>
        <name>ModifyAllData</name>
    </userPermissions>
</Profile>

and we had a file xpath/objects/Account.xpath with the contents of

/Profile/userPermissions[name[text() = 'ModerateChatter']]
/Profile/userPermissions/[name[text() = 'ModifyAllData']]

the result would be

<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
    <!-- Lots more data goes here -->
    <userPermissions>
        <enabled>true</enabled>
        <name>MergeTopics</name>
    </userPermissions>
</Profile>
@pcon
Copy link
Member Author

pcon commented Nov 11, 2015

Can we also make sure these XPATHs / XSLs can be run against the -meta.xml files? Would be useful for converting

<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>35.0</apiVersion>
    <packageVersions>
        <majorNumber>1</majorNumber>
        <minorNumber>4</minorNumber>
        <namespace>relax</namespace>
    </packageVersions>
    <status>Active</status>
</ApexClass>

to

<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>35.0</apiVersion>
    <status>Active</status>
</ApexClass>

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

No branches or pull requests

2 participants